smsc911x: timeout reaches -1
Subsystems (2)
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.
Signed-off-by Roel Kluin <[email protected]>
---
drivers/net/smsc911x.c +1 -1
@@ -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 "
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.
Signed-off-by Roel Kluin <[email protected]>---
drivers/net/smsc911x.c +1
-1@@ -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.
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.
Signed-off-by Roel Kluin <[email protected]>---
drivers/net/smsc911x.c +1
-1@@ -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
-0if (unlikely (timeout ==0 ))SMSC_WARNING(HW, "Timed out waiting for "
Thanks for spotting this Roel.
Applied, thanks everyone.