diff options
author | David S. Miller <davem@davemloft.net> | 2012-06-28 00:28:14 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-06-28 00:28:14 -0400 |
commit | 160c85f0e050d92c0e42321aab2ffc343594e1c0 (patch) | |
tree | 1ba2d2bafc0eee95b4c747666fb8868c01ffeb19 | |
parent | d4fc6918f4b3cc844185f59fc518351525950449 (diff) |
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: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/phy/phy_device.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index ef4cdeebedd6..47e02e7dc737 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c | |||
@@ -327,9 +327,9 @@ static int get_phy_id(struct mii_bus *bus, int addr, u32 *phy_id, | |||
327 | */ | 327 | */ |
328 | struct phy_device *get_phy_device(struct mii_bus *bus, int addr, bool is_c45) | 328 | struct phy_device *get_phy_device(struct mii_bus *bus, int addr, bool is_c45) |
329 | { | 329 | { |
330 | struct phy_device *dev = NULL; | ||
331 | u32 phy_id; | ||
332 | struct phy_c45_device_ids c45_ids = {0}; | 330 | struct phy_c45_device_ids c45_ids = {0}; |
331 | struct phy_device *dev = NULL; | ||
332 | u32 phy_id = 0; | ||
333 | int r; | 333 | int r; |
334 | 334 | ||
335 | r = get_phy_id(bus, addr, &phy_id, is_c45, &c45_ids); | 335 | r = get_phy_id(bus, addr, &phy_id, is_c45, &c45_ids); |