Skip to contentSkip to conversation

smsc911x: timeout reaches -1

PATCH Applied Roel Kluin 3 participants 3 messages Jan 29, 2009 – Jan 30, 2009

Subsystems (2)
lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 smsc911x: timeout reaches -1

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

---

drivers/net/smsc911x.c +1 -1
index f513bdf..783c1a7 100644
@@ -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 "
Acked-by on v1 1/1
#1 lore raw

Roel Kluin <[email protected]> wrote on 29/01/2009 15:12:03:

Quoted 18 lines

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

---

drivers/net/smsc911x.c +1 -1
index f513bdf..783c1a7 100644
@@ -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))
Quoted 1 line

SMSC_WARNING(HW, "Timed out waiting for "

Thanks for spotting this Roel.

maintainer Applied
#2 lore raw

From: [email protected]
Date: Thu, 29 Jan 2009 15:22:03 +0000

Quoted 19 lines

Roel Kluin <[email protected]> wrote on 29/01/2009 15:12:03:

Quoted 17 lines

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

---

drivers/net/smsc911x.c +1 -1
index f513bdf..783c1a7 100644
@@ -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_));
 
Quoted 6 lines
Quoted 2 lines
drivers/net/smsc911x.c +0 -0
       if (unlikely(timeout == 0))

SMSC_WARNING(HW, "Timed out waiting for "

Thanks for spotting this Roel.

Applied, thanks everyone.