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

Commit ba4fbb68 authored by Tom Rix's avatar Tom Rix Committed by Greg Kroah-Hartman
Browse files

igc: change default return of igc_read_phy_reg()



[ Upstream commit 05682a0a61b6cbecd97a0f37f743b2cbfd516977 ]

Static analysis reports this problem

igc_main.c:4944:20: warning: The left operand of '&'
  is a garbage value
    if (!(phy_data & SR_1000T_REMOTE_RX_STATUS) &&
          ~~~~~~~~ ^

phy_data is set by the call to igc_read_phy_reg() only if
there is a read_reg() op, else it is unset and a 0 is
returned.  Change the return to -EOPNOTSUPP.

Fixes: 208983f0 ("igc: Add watchdog")
Signed-off-by: default avatarTom Rix <trix@redhat.com>
Tested-by: default avatarDvora Fuxbrumer <dvorax.fuxbrumer@linux.intel.com>
Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 88e07201
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -504,7 +504,7 @@ static inline s32 igc_read_phy_reg(struct igc_hw *hw, u32 offset, u16 *data)
	if (hw->phy.ops.read_reg)
	if (hw->phy.ops.read_reg)
		return hw->phy.ops.read_reg(hw, offset, data);
		return hw->phy.ops.read_reg(hw, offset, data);


	return 0;
	return -EOPNOTSUPP;
}
}


/* forward declaration */
/* forward declaration */