netxen: reversed condition in netxen_nic_set_link_parameters()
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 5 May 2016 13:19:44 +0000 (16:19 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sat, 7 May 2016 19:15:32 +0000 (15:15 -0400)
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 <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c

index a3205410bb605e066e3e4814327855aab8e9b25d..2b10f1bcd1517458b2cfcb22e6ce4677995181a8 100644 (file)
@@ -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;