• Arnd Bergmann's avatar
    scsi: lpfc: avoid harmless comparison warning · de8c36bb
    Arnd Bergmann authored
    When building with -Wextra, we get a lot of warnings for the lpfc driver
    concerning expressions that are always true, starting with:
    
    drivers/scsi/lpfc/lpfc_attr.c: In function 'lpfc_enable_npiv_init':
    drivers/scsi/lpfc/lpfc_attr.c:2786:77: error: comparison of unsigned expression >= 0 is always true [-Werror=type-limits]
    drivers/scsi/lpfc/lpfc_attr.c: In function 'lpfc_enable_rrq_init':
    drivers/scsi/lpfc/lpfc_attr.c:2802:76: error: comparison of unsigned expression >= 0 is always true [-Werror=type-limits]
    drivers/scsi/lpfc/lpfc_attr.c: In function 'lpfc_suppress_link_up_init':
    drivers/scsi/lpfc/lpfc_attr.c:2812:2050: error: comparison of unsigned expression >= 0 is always true [-Werror=type-limits]
    drivers/scsi/lpfc/lpfc_attr.c: In function 'lpfc_log_verbose_init':
    drivers/scsi/lpfc/lpfc_attr.c:3064:1930: error: comparison of unsigned expression >= 0 is always true [-Werror=type-limits]
    
    The code works as intended, but it would be nice to shut up the warning
    so we don't clutter up build logs with this. Using a separate inline
    function for it makes it clear to the compiler that the comparison is
    necessary in the caller but still lets it do the constant-folding.
    
    [mkp: fix typo]
    Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
    Reviewed-by: default avatarJohannes Thumshirn <jthumshirn@suse.de>
    Acked-by: default avatarJames Smart <james.smart@broadcom.com>
    Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
    de8c36bb
Name
Last commit
Last update
Documentation Loading commit data...
arch Loading commit data...
block Loading commit data...
certs Loading commit data...
crypto Loading commit data...
drivers Loading commit data...
firmware Loading commit data...
fs Loading commit data...
include Loading commit data...
init Loading commit data...
ipc Loading commit data...
kernel Loading commit data...
lib Loading commit data...
mm Loading commit data...
net Loading commit data...
samples Loading commit data...
scripts Loading commit data...
security Loading commit data...
sound Loading commit data...
tools Loading commit data...
usr Loading commit data...
virt Loading commit data...
.get_maintainer.ignore Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
COPYING Loading commit data...
CREDITS Loading commit data...
Kbuild Loading commit data...
Kconfig Loading commit data...
MAINTAINERS Loading commit data...
Makefile Loading commit data...
README Loading commit data...
REPORTING-BUGS Loading commit data...