netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch -mainline] sfc: fix a timeout loop
@ 2015-12-15 11:06 Dan Carpenter
  2015-12-15 17:52 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2015-12-15 11:06 UTC (permalink / raw)
  To: Solarflare linux maintainers; +Cc: Shradha Shah, netdev, kernel-janitors

We test for if "tries" is zero at the end but "tries--" is a post-op so
it will end with "tries" set to -1.  I have changed it to a pre-op
instead.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/net/ethernet/sfc/txc43128_phy.c b/drivers/net/ethernet/sfc/txc43128_phy.c
index 3d5ee32..194f67d 100644
--- a/drivers/net/ethernet/sfc/txc43128_phy.c
+++ b/drivers/net/ethernet/sfc/txc43128_phy.c
@@ -418,7 +418,7 @@ static void txc_reset_logic_mmd(struct efx_nic *efx, int mmd)
 
 	val |= (1 << TXC_GLCMD_LMTSWRST_LBN);
 	efx_mdio_write(efx, mmd, TXC_GLRGS_GLCMD, val);
-	while (tries--) {
+	while (--tries) {
 		val = efx_mdio_read(efx, mmd, TXC_GLRGS_GLCMD);
 		if (!(val & (1 << TXC_GLCMD_LMTSWRST_LBN)))
 			break;

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

* Re: [patch -mainline] sfc: fix a timeout loop
  2015-12-15 11:06 [patch -mainline] sfc: fix a timeout loop Dan Carpenter
@ 2015-12-15 17:52 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2015-12-15 17:52 UTC (permalink / raw)
  To: dan.carpenter; +Cc: linux-net-drivers, sshah, netdev, kernel-janitors

From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Tue, 15 Dec 2015 14:06:08 +0300

> We test for if "tries" is zero at the end but "tries--" is a post-op so
> it will end with "tries" set to -1.  I have changed it to a pre-op
> instead.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied.

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

end of thread, other threads:[~2015-12-15 17:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-15 11:06 [patch -mainline] sfc: fix a timeout loop Dan Carpenter
2015-12-15 17:52 ` 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).