]> git.baikalelectronics.ru Git - kernel.git/commit
bcm63xx_enet: avoid uninitialized variable warning
authorArnd Bergmann <arnd@arndb.de>
Wed, 18 Jan 2017 14:52:53 +0000 (15:52 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 20 Jan 2017 16:45:37 +0000 (11:45 -0500)
commit43a9a2c56f111acaa03ae1fe079472af9475079b
treef2b91f744f32f734373a30e01bab5cea8b6c5ca7
parent5281570e1345770e5b8a351037f507dfb831d307
bcm63xx_enet: avoid uninitialized variable warning

gcc-7 and probably earlier versions get confused by this function
and print a harmless warning:

drivers/net/ethernet/broadcom/bcm63xx_enet.c: In function 'bcm_enet_open':
drivers/net/ethernet/broadcom/bcm63xx_enet.c:1130:3: error: 'phydev' may be used uninitialized in this function [-Werror=maybe-uninitialized]

This adds an initialization for the 'phydev' variable when it is unused
and changes the check to test for that NULL pointer to make it clear
that we always pass a valid pointer here.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bcm63xx_enet.c