• Nathan Chancellor's avatar
    scsi: mpt3sas: Remove unnecessary parentheses and simplify null checks · b51d577a
    Nathan Chancellor authored
    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: default avatarNathan Chancellor <natechancellor@gmail.com>
    Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
    b51d577a
mpt3sas_base.c 193 KB