From: James Smart <james.smart@broadcom.com>
To: Arnd Bergmann <arnd@arndb.de>,
Dick Kennedy <dick.kennedy@broadcom.com>,
"James E.J. Bottomley" <jejb@linux.vnet.ibm.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Hannes Reinecke <hare@suse.com>,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] scsi: lpfc: avoid false-positive gcc-8 warning
Date: Wed, 23 Aug 2017 09:20:52 -0700 [thread overview]
Message-ID: <82a428c6-a1d9-00e9-8a6c-fb8f2a84828f@broadcom.com> (raw)
In-Reply-To: <20170823150143.2746796-1-arnd@arndb.de>
On 8/23/2017 8:01 AM, Arnd Bergmann wrote:
> This is an interesting regression with gcc-8, showing a harmless
> warning for correct code:
>
> In file included from include/linux/kernel.h:13:0,
> ...
> from drivers/scsi/lpfc/lpfc_debugfs.c:23:
> include/linux/printk.h:301:2: error: 'eq' may be used uninitialized in this function [-Werror=maybe-uninitialized]
> printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
> ^~~~~~
> In file included from drivers/scsi/lpfc/lpfc_debugfs.c:58:0:
> drivers/scsi/lpfc/lpfc_debugfs.h:451:31: note: 'eq' was declared here
>
> I tried to come up with a reduced test case for gcc here
> a few times, but every time ended up with code that is actually
> wrong with older gcc versions missing the bug and gcc-8 finding
> it. As this is the only false-positive -Wmaybe-uninitialized
> warnign I got with gcc-8 randconfig builds, I'd suggest we
> work around it.
>
> Making the index variable 'unsigned' is enough to shut up
> the warning, as gcc can then see that comparing eqidx to
> phba->io_channel_irqs is fine here.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> drivers/scsi/lpfc/lpfc_debugfs.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>
looks good. Thanks
Signed-off-by: James Smart <james.smart@broadcom.com>
-- james
next prev parent reply other threads:[~2017-08-23 16:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-23 15:01 Arnd Bergmann
2017-08-23 16:20 ` James Smart [this message]
2017-08-23 19:02 ` Arnd Bergmann
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=82a428c6-a1d9-00e9-8a6c-fb8f2a84828f@broadcom.com \
--to=james.smart@broadcom.com \
--cc=arnd@arndb.de \
--cc=dick.kennedy@broadcom.com \
--cc=hare@suse.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
all inboxes | Powered by JetHome®