From: Don Skidmore Date: Thu, 28 Jul 2011 01:00:58 +0000 (+0000) Subject: ixgbe: fix ixgbe_fc_autoneg_fiber bug X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=53f096de3a2d04dc034b9dbcb160c6448960309d;p=openwrt%2Fstaging%2Fblogic.git 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: Don Skidmore Tested-by: Phil Schmitt Signed-off-by: Jeff Kirsher --- diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c index fc1375f26fe5..90a04e2471df 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c @@ -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; }