]> git.baikalelectronics.ru Git - kernel.git/commit
net: hns: avoid uninitialized variable warning:
authorArnd Bergmann <arnd@arndb.de>
Fri, 1 Jan 2016 22:27:57 +0000 (23:27 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 6 Jan 2016 05:00:11 +0000 (00:00 -0500)
commit99a92019292a8b2b37a01e20dd4a3d5007679b5d
treeae8dc8eb20a4dc94624ee2f428e58951e5d2bb07
parentec7e85d858ed8fcdd76d989e31923b797d9273bb
net: hns: avoid uninitialized variable warning:

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>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns/hns_enet.c