bcm63xx_enet: avoid uninitialized variable warning
authorArnd Bergmann <arnd@arndb.de>
Wed, 18 Jan 2017 14:52:53 +0000 (15:52 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 18 Mar 2017 11:14:29 +0000 (19:14 +0800)
commit04275d2a8af3269e2b0e04512a6b261dd3245545
tree6f326a68ab267d84646d3ad715ea23c1e2af5982
parentb7e968da04d77174477317b1b032be7f62ad856d
bcm63xx_enet: avoid uninitialized variable warning

commit df384d435a5c034c735df3d9ea87a03172c59b56 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/broadcom/bcm63xx_enet.c