Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1449675

Re: [PATCH net-next] net/ncsi: avoid maybe-uninitialized warning

From David Miller <davem@davemloft.net>
Newsgroups linux.kernel
Subject Re: [PATCH net-next] net/ncsi: avoid maybe-uninitialized warning
Date 2016-07-25 19:40 +0200
Message-ID <rYS1c-7ph-19@gated-at.bofh.it> (permalink)
References <rXrPr-3ny-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Arnd Bergmann <arnd@arndb.de>
Date: Thu, 21 Jul 2016 21:28:34 +0200

> 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>

Applied.

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH net-next] net/ncsi: avoid maybe-uninitialized warning Arnd Bergmann <arnd@arndb.de> - 2016-07-21 21:30 +0200
  Re: [PATCH net-next] net/ncsi: avoid maybe-uninitialized warning Gavin Shan <gwshan@linux.vnet.ibm.com> - 2016-07-22 02:20 +0200
  Re: [PATCH net-next] net/ncsi: avoid maybe-uninitialized warning David Miller <davem@davemloft.net> - 2016-07-25 19:40 +0200

csiph-web