Re: [PATCH] smsc911x: timeout reaches -1

Previous thread: ipv6: INFO: possible circular locking dependency detected -- 2.6.29-rc3 by arrow.ebd on Thursday, January 29, 2009 - 5:43 am. (2 messages)

Next thread: [PATCH 0/1] smsc9420: fix interrupt signalling test failures by Steve Glendinning on Thursday, January 29, 2009 - 9:39 am. (3 messages)
From: Roel Kluin
Date: Thursday, January 29, 2009 - 8:12 am

With a postfix decrement the timeout will reach -1 rather than 0,
so the warning will not be issued.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c
index f513bdf..783c1a7 100644
--- a/drivers/net/smsc911x.c
+++ b/drivers/net/smsc911x.c
@@ -953,7 +953,7 @@ smsc911x_rx_fastforward(struct smsc911x_data *pdata, unsigned int pktbytes)
 		do {
 			udelay(1);
 			val = smsc911x_reg_read(pdata, RX_DP_CTRL);
-		} while (timeout-- && (val & RX_DP_CTRL_RX_FFWD_));
+		} while (--timeout && (val & RX_DP_CTRL_RX_FFWD_));
 
 		if (unlikely(timeout == 0))
 			SMSC_WARNING(HW, "Timed out waiting for "
--

From: Steve.Glendinning
Date: Thursday, January 29, 2009 - 8:22 am

Thanks for spotting this Roel.

Acked-by: Steve Glendinning <steve.glendinning@smsc.com>

--

From: David Miller
Date: Thursday, January 29, 2009 - 6:30 pm

From: Steve.Glendinning@smsc.com

Applied, thanks everyone.
--

Previous thread: ipv6: INFO: possible circular locking dependency detected -- 2.6.29-rc3 by arrow.ebd on Thursday, January 29, 2009 - 5:43 am. (2 messages)

Next thread: [PATCH 0/1] smsc9420: fix interrupt signalling test failures by Steve Glendinning on Thursday, January 29, 2009 - 9:39 am. (3 messages)