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

Commit 53f096de authored by Don Skidmore's avatar Don Skidmore Committed by Jeff Kirsher
Browse files

ixgbe: fix ixgbe_fc_autoneg_fiber bug



A logic error in ixgbe_fc_autoneg_fiber() that treated a masked u32 as a
boolean would make it so we would never fall hit a error check case.  So
now I force the u32 to a boolean value with '!!'.

Signed-off-by: default avatarDon Skidmore <donald.c.skidmore@intel.com>
Tested-by: default avatarPhil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 6a864abb
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2121,8 +2121,8 @@ static s32 ixgbe_fc_autoneg_fiber(struct ixgbe_hw *hw)
	 */

	linkstat = IXGBE_READ_REG(hw, IXGBE_PCS1GLSTA);
	if (((linkstat & IXGBE_PCS1GLSTA_AN_COMPLETE) == 0) ||
	    ((linkstat & IXGBE_PCS1GLSTA_AN_TIMED_OUT) == 1)) {
	if ((!!(linkstat & IXGBE_PCS1GLSTA_AN_COMPLETE) == 0) ||
	    (!!(linkstat & IXGBE_PCS1GLSTA_AN_TIMED_OUT) == 1)) {
		ret_val = IXGBE_ERR_FC_NOT_NEGOTIATED;
		goto out;
	}