• Arnd Bergmann's avatar
    net/ncsi: avoid maybe-uninitialized warning · a1b43edd
    Arnd Bergmann authored
    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: default avatarArnd Bergmann <arnd@arndb.de>
    Acked-by: default avatarGavin Shan <gwshan@linux.vnet.ibm.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    a1b43edd
Name
Last commit
Last update
..
Kconfig Loading commit data...
Makefile Loading commit data...
internal.h Loading commit data...
ncsi-aen.c Loading commit data...
ncsi-cmd.c Loading commit data...
ncsi-manage.c Loading commit data...
ncsi-pkt.h Loading commit data...
ncsi-rsp.c Loading commit data...