From: Johannes Thumshirn <jthumshirn@suse.de>
To: Arnd Bergmann <arnd@arndb.de>
Cc: "James E.J. Bottomley" <jejb@linux.vnet.ibm.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
James Smart <james.smart@avagotech.com>,
Dick Kennedy <dick.kennedy@avagotech.com>,
Hannes Reinicke <hare@suse.de>,
James Bottomley <JBottomley@Odin.com>,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] scsi: lpfc: avoid harmless comparison warning
Date: Thu, 16 Jun 2016 09:39:10 +0200 [thread overview]
Message-ID: <20160616073910.q6cw2j36uq5c4ngx@c203.arch.suse.de> (raw)
In-Reply-To: <20160615204231.3784044-1-arnd@arndb.de>
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
next prev parent reply other threads:[~2016-06-16 7:39 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-15 20:42 [PATCH 1/2] scsi: lpfc: avoid harmless comparison warning Arnd Bergmann
2016-06-15 20:54 ` [PATCH 2/2] scsi: wd7000: print sector number as 64-bit Arnd Bergmann
2016-06-16 17:36 ` kbuild test robot
2016-06-17 11:45 ` Arnd Bergmann
2016-06-21 1:12 ` Martin K. Petersen
2016-06-21 11:41 ` Arnd Bergmann
2016-06-16 7:39 ` Johannes Thumshirn [this message]
2016-07-14 3:15 ` [PATCH 1/2] scsi: lpfc: avoid harmless comparison warning Martin K. Petersen
2016-07-15 19:16 ` James Smart
2016-07-20 23:54 ` Martin K. Petersen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160616073910.q6cw2j36uq5c4ngx@c203.arch.suse.de \
--to=jthumshirn@suse.de \
--cc=JBottomley@Odin.com \
--cc=arnd@arndb.de \
--cc=dick.kennedy@avagotech.com \
--cc=hare@suse.de \
--cc=james.smart@avagotech.com \
--cc=jejb@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).