Skip to content

Commit 28b18e4

Browse files
Tom Rixdavem330
authored andcommitted
net: sky2: initialize return of gm_phy_read
clang static analysis flags this garbage return drivers/net/ethernet/marvell/sky2.c:208:2: warning: Undefined or garbage value returned to caller [core.uninitialized.UndefReturn] return v; ^~~~~~~~ static inline u16 gm_phy_read( ... { u16 v; __gm_phy_read(hw, port, reg, &v); return v; } __gm_phy_read can return without setting v. So handle similar to skge.c's gm_phy_read, initialize v. Signed-off-by: Tom Rix <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent ad0f75e commit 28b18e4

File tree

1 file changed

+1
-1
lines changed
  • drivers/net/ethernet/marvell

1 file changed

+1
-1
lines changed

drivers/net/ethernet/marvell/sky2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ static int __gm_phy_read(struct sky2_hw *hw, unsigned port, u16 reg, u16 *val)
203203

204204
static inline u16 gm_phy_read(struct sky2_hw *hw, unsigned port, u16 reg)
205205
{
206-
u16 v;
206+
u16 v = 0;
207207
__gm_phy_read(hw, port, reg, &v);
208208
return v;
209209
}

0 commit comments

Comments
 (0)