Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 160c85f0 authored by David S. Miller's avatar David S. Miller
Browse files

phy: Fix warning in get_phy_device().



drivers/net/phy/phy_device.c: In function ‘get_phy_device’:
drivers/net/phy/phy_device.c:340:14: warning: ‘phy_id’ may be used uninitialized in this function [-Wmaybe-uninitialized]

GCC can't see that when we return zero we always initialize
phy_id and that's the only path where we use it.

Initialize phy_id to zero to shut it up.

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d4fc6918
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -327,9 +327,9 @@ static int get_phy_id(struct mii_bus *bus, int addr, u32 *phy_id,
 */
struct phy_device *get_phy_device(struct mii_bus *bus, int addr, bool is_c45)
{
	struct phy_device *dev = NULL;
	u32 phy_id;
	struct phy_c45_device_ids c45_ids = {0};
	struct phy_device *dev = NULL;
	u32 phy_id = 0;
	int r;

	r = get_phy_id(bus, addr, &phy_id, is_c45, &c45_ids);