aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/smsc911x.c
diff options
context:
space:
mode:
authorSteve Glendinning <steve.glendinning@smsc.com>2009-03-04 02:33:24 -0500
committerDavid S. Miller <davem@davemloft.net>2009-03-13 15:14:09 -0400
commit8dacd548129d03e87751f75ea83b42a8a17ee651 (patch)
tree7fcb04f42b116a303f1b446fbf201c8ebb004749 /drivers/net/smsc911x.c
parent273ae44b9cb9443e0b5265cdc99f127ddb95c8db (diff)
smsc911x: check for FFWD success before checking for timeout
This patch from Juha Leppanen suppresses a false warning if a fast forward operation succeeds on the very last attempt. Juha> If smsc911x_reg_read loop is executed 500 times, timeout reaches 0 Juha> and the 500th smsc911x_reg_read result in val is ignored. If Juha> testing order is changed, then val is checked first. The 500th Juha> reg_read might be GOOD, why ignore it! Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/smsc911x.c')
-rw-r--r--drivers/net/smsc911x.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c
index dceae8a65809..9a795105cc7c 100644
--- a/drivers/net/smsc911x.c
+++ b/drivers/net/smsc911x.c
@@ -955,7 +955,7 @@ smsc911x_rx_fastforward(struct smsc911x_data *pdata, unsigned int pktbytes)
955 do { 955 do {
956 udelay(1); 956 udelay(1);
957 val = smsc911x_reg_read(pdata, RX_DP_CTRL); 957 val = smsc911x_reg_read(pdata, RX_DP_CTRL);
958 } while (--timeout && (val & RX_DP_CTRL_RX_FFWD_)); 958 } while ((val & RX_DP_CTRL_RX_FFWD_) && --timeout);
959 959
960 if (unlikely(timeout == 0)) 960 if (unlikely(timeout == 0))
961 SMSC_WARNING(HW, "Timed out waiting for " 961 SMSC_WARNING(HW, "Timed out waiting for "