From: Dan Carpenter Date: Thu, 5 May 2016 13:19:44 +0000 (+0300) Subject: netxen: reversed condition in netxen_nic_set_link_parameters() X-Git-Tag: v4.9.8~2188^2~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1c755ffa4fa3e2d4112cadd30142344789ad2fd2;p=platform%2Fkernel%2Flinux-rpi3.git netxen: reversed condition in netxen_nic_set_link_parameters() My static checker complains that we are using "autoneg" without initializing it. The problem is the ->phy_read() condition is reversed so we only set this on error instead of success. Signed-off-by: Dan Carpenter Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c index a320541..2b10f1b 100644 --- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c +++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c @@ -1944,7 +1944,7 @@ void netxen_nic_set_link_parameters(struct netxen_adapter *adapter) if (adapter->phy_read && adapter->phy_read(adapter, NETXEN_NIU_GB_MII_MGMT_ADDR_AUTONEG, - &autoneg) != 0) + &autoneg) == 0) adapter->link_autoneg = autoneg; } else goto link_down;