Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1423748
| From | Johannes Thumshirn <jthumshirn@suse.de> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 1/2] scsi: lpfc: avoid harmless comparison warning |
| Date | 2016-06-16 09:40 +0200 |
| Message-ID | <rKA49-5o9-3@gated-at.bofh.it> (permalink) |
| References | <rKpV7-7iY-15@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Wed, Jun 15, 2016 at 10:42:17PM +0200, Arnd Bergmann wrote: > 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 intented, 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. > > Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> -- Johannes Thumshirn Storage jthumshirn@suse.de +49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH 1/2] scsi: lpfc: avoid harmless comparison warning Arnd Bergmann <arnd@arndb.de> - 2016-06-15 22:50 +0200
[PATCH 2/2] scsi: wd7000: print sector number as 64-bit Arnd Bergmann <arnd@arndb.de> - 2016-06-15 23:00 +0200
Re: [PATCH 2/2] scsi: wd7000: print sector number as 64-bit "Martin K. Petersen" <martin.petersen@oracle.com> - 2016-06-21 03:20 +0200
Re: [PATCH 2/2] scsi: wd7000: print sector number as 64-bit Arnd Bergmann <arnd@arndb.de> - 2016-06-21 13:50 +0200
Re: [PATCH 1/2] scsi: lpfc: avoid harmless comparison warning Johannes Thumshirn <jthumshirn@suse.de> - 2016-06-16 09:40 +0200
csiph-web