]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
net: tg3: avoid uninitialized variable warning
authorArnd Bergmann <arnd@arndb.de>
Fri, 29 Jan 2016 11:39:15 +0000 (12:39 +0100)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 8 May 2017 12:54:38 +0000 (14:54 +0200)
commitab6965bf93620a2975c05b98974c72e2a667b3dc
tree60eb1f4bccff5c550147a62bf03452df5de77390
parent0c287d14f0ca3b4f2dbaa2e1ad58e3f50e471f9d
net: tg3: avoid uninitialized variable warning

BugLink: http://bugs.launchpad.net/bugs/1689296
commit e434e04110704eb91acfecbd0fb8ca8e2da9c29b upstream.

The tg3_set_eeprom() function correctly initializes the 'start' variable,
but gcc generates a false warning:

drivers/net/ethernet/broadcom/tg3.c: In function 'tg3_set_eeprom':
drivers/net/ethernet/broadcom/tg3.c:12057:4: warning: 'start' may be used uninitialized in this function [-Wmaybe-uninitialized]

I have not come up with a way to restructure the code in a way that
avoids the warning without making it less readable, so this adds an
initialization for the declaration to shut up that warning.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
drivers/net/ethernet/broadcom/tg3.c