From: Gavin Shan <gwshan@linux.vnet.ibm.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: "David S. Miller" <davem@davemloft.net>,
Gavin Shan <gwshan@linux.vnet.ibm.com>,
Joel Stanley <joel@jms.id.au>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next] net/ncsi: avoid maybe-uninitialized warning
Date: Fri, 22 Jul 2016 10:11:40 +1000 [thread overview]
Message-ID: <20160722001140.GA9305@gwshan> (raw)
In-Reply-To: <20160721192927.3182806-1-arnd@arndb.de>
On Thu, Jul 21, 2016 at 09:28:34PM +0200, Arnd Bergmann wrote:
>gcc-4.9 and higher warn about the newly added NSCI code:
>
>net/ncsi/ncsi-manage.c: In function 'ncsi_process_next_channel':
>net/ncsi/ncsi-manage.c:1003:2: error: 'old_state' may be used uninitialized in this function [-Werror=maybe-uninitialized]
>
>The warning is a false positive and therefore harmless, but it would be good to
>avoid it anyway. I have determined that the barrier in the spin_unlock_irqsave()
>is what confuses gcc to the point that it cannot track whether the variable
>was unused or not.
>
>This rearranges the code in a way that makes it obvious to gcc that old_state
>is always initialized at the time of use, functionally this should not
>change anything.
>
>Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
next prev parent reply other threads:[~2016-07-22 0:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-21 19:28 [PATCH net-next] net/ncsi: avoid maybe-uninitialized warning Arnd Bergmann
2016-07-22 0:11 ` Gavin Shan [this message]
2016-07-25 17:33 ` David Miller
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=20160722001140.GA9305@gwshan \
--to=gwshan@linux.vnet.ibm.com \
--cc=arnd@arndb.de \
--cc=davem@davemloft.net \
--cc=joel@jms.id.au \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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).