netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 2/2] netxen: reversed condition in netxen_nic_set_link_parameters()
@ 2016-05-05 13:19 Dan Carpenter
  2016-05-07 19:16 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2016-05-05 13:19 UTC (permalink / raw)
  To: Manish Chopra
  Cc: Sony Chacko, Rajesh Borundia, netdev, linux-kernel,
	kernel-janitors

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>

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;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch 2/2] netxen: reversed condition in netxen_nic_set_link_parameters()
  2016-05-05 13:19 [patch 2/2] netxen: reversed condition in netxen_nic_set_link_parameters() Dan Carpenter
@ 2016-05-07 19:16 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2016-05-07 19:16 UTC (permalink / raw)
  To: dan.carpenter
  Cc: manish.chopra, sony.chacko, rajesh.borundia, netdev, linux-kernel,
	kernel-janitors

From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Thu, 5 May 2016 16:19:44 +0300

> 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>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-05-07 19:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-05 13:19 [patch 2/2] netxen: reversed condition in netxen_nic_set_link_parameters() Dan Carpenter
2016-05-07 19:16 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).