Thread (5 messages) flat view 5 messages, 4 authors, 2016-01-06

[PATCH] net: hns: avoid uninitialized variable warning:

From: davem@davemloft.net (David Miller)
Date: 2016-01-06 05:01:16
Also in: lkml, netdev

From: Arnd Bergmann <arnd@arndb.de>
Date: Fri, 01 Jan 2016 23:27:57 +0100
gcc fails to see that the use of the 'last_offset' variable
in hns_nic_reuse_page() is used correctly and issues a bogus
warning:

drivers/net/ethernet/hisilicon/hns/hns_enet.c: In function 'hns_nic_reuse_page':
drivers/net/ethernet/hisilicon/hns/hns_enet.c:541:6: warning: 'last_offset' may be used uninitialized in this function [-Wmaybe-uninitialized]

This simplifies the function to make it more obvious what is
going on to both readers and compilers, which makes the warning
go away.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Applied, thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help