mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
scsi: mpt3sas: Remove unnecessary parentheses and simplify null checks
Clang warns when multiple pairs of parentheses are used for a single
conditional statement.
drivers/scsi/mpt3sas/mpt3sas_base.c:535:11: warning: equality comparison
with extraneous parentheses [-Wparentheses-equality]
if ((ioc == NULL))
~~~~^~~~~~~
drivers/scsi/mpt3sas/mpt3sas_base.c:535:11: note: remove extraneous
parentheses around the comparison to silence this warning
if ((ioc == NULL))
~ ^ ~
drivers/scsi/mpt3sas/mpt3sas_base.c:535:11: note: use '=' to turn this
equality comparison into an assignment
if ((ioc == NULL))
^~
=
drivers/scsi/mpt3sas/mpt3sas_base.c:539:12: warning: equality comparison
with extraneous parentheses [-Wparentheses-equality]
if ((pdev == NULL))
~~~~~^~~~~~~
drivers/scsi/mpt3sas/mpt3sas_base.c:539:12: note: remove extraneous
parentheses around the comparison to silence this warning
if ((pdev == NULL))
~ ^ ~
drivers/scsi/mpt3sas/mpt3sas_base.c:539:12: note: use '=' to turn this
equality comparison into an assignment
if ((pdev == NULL))
^~
=
2 warnings generated.
Remove them and while we're at it, simplify the NULL checks as '!var' is
used more than 'var == NULL'.
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
committed by
Martin K. Petersen
parent
c39a4d7553
commit
b51d577a51
@@ -530,11 +530,11 @@ static int mpt3sas_remove_dead_ioc_func(void *arg)
|
||||
struct MPT3SAS_ADAPTER *ioc = (struct MPT3SAS_ADAPTER *)arg;
|
||||
struct pci_dev *pdev;
|
||||
|
||||
if ((ioc == NULL))
|
||||
if (!ioc)
|
||||
return -1;
|
||||
|
||||
pdev = ioc->pdev;
|
||||
if ((pdev == NULL))
|
||||
if (!pdev)
|
||||
return -1;
|
||||
pci_stop_and_remove_bus_device_locked(pdev);
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user