diff options
author | Arnd Bergmann <arnd@arndb.de> | 2016-01-29 06:39:15 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-01-29 23:33:39 -0500 |
commit | e434e04110704eb91acfecbd0fb8ca8e2da9c29b (patch) | |
tree | 6e94790bc109bd4867b580ec9199443b106875f8 | |
parent | 8bdb290896d2ff22942c9c9f5bf19909329f3664 (diff) |
net: tg3: avoid uninitialized variable warning
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>
-rw-r--r-- | drivers/net/ethernet/broadcom/tg3.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index 9293675df7ba..49eea8981332 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c | |||
@@ -12016,7 +12016,7 @@ static int tg3_set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom, | |||
12016 | int ret; | 12016 | int ret; |
12017 | u32 offset, len, b_offset, odd_len; | 12017 | u32 offset, len, b_offset, odd_len; |
12018 | u8 *buf; | 12018 | u8 *buf; |
12019 | __be32 start, end; | 12019 | __be32 start = 0, end; |
12020 | 12020 | ||
12021 | if (tg3_flag(tp, NO_NVRAM) || | 12021 | if (tg3_flag(tp, NO_NVRAM) || |
12022 | eeprom->magic != TG3_EEPROM_MAGIC) | 12022 | eeprom->magic != TG3_EEPROM_MAGIC) |