]> git.baikalelectronics.ru Git - kernel.git/commit
mdio: mux: avoid 'maybe-uninitialized' warning
authorArnd Bergmann <arnd@arndb.de>
Tue, 14 Jun 2016 10:03:17 +0000 (12:03 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 16 Jun 2016 03:48:52 +0000 (20:48 -0700)
commita67d0b6a0db43a6de94f46b8006298759aafc0da
treef1ed5c55c400b65674e167c1a425449600666722
parentc1b7a247e66b20b99eea7d2f13d6fe25bc32137b
mdio: mux: avoid 'maybe-uninitialized' warning

The latest changes to the MDIO code introduced a false-positive
warning with gcc-6 (possibly others):

drivers/net/phy/mdio-mux.c: In function 'mdio_mux_init':
drivers/net/phy/mdio-mux.c:188:3: error: 'parent_bus_node' may be used uninitialized in this function [-Werror=maybe-uninitialized]

It's easy to avoid the warning by making sure the parent_bus_node
is initialized in both cases at the start of the function, since
the later 'of_node_put()' call is also valid for a NULL pointer
argument.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 8fbf50a96534 ("mdio: mux: Enhanced MDIO mux framework for integrated multiplexers")
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/mdio-mux.c