[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1236188005-14065-1-git-send-email-steve.glendinning@smsc.com>
Date: Wed, 4 Mar 2009 17:33:24 +0000
From: Steve Glendinning <steve.glendinning@...c.com>
To: netdev@...r.kernel.org
Cc: Roel Kluin <roel.kluin@...il.com>,
Juha Leppanen <juha_motorsportcom@...kku.com>,
Ian Saturley <ian.saturley@...c.com>,
David Miller <davem@...emloft.net>,
Steve Glendinning <steve.glendinning@...c.com>
Subject: [PATCH 1/2] 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@...c.com>
---
drivers/net/smsc911x.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c
index dceae8a..9a79510 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)
do {
udelay(1);
val = smsc911x_reg_read(pdata, RX_DP_CTRL);
- } while (--timeout && (val & RX_DP_CTRL_RX_FFWD_));
+ } while ((val & RX_DP_CTRL_RX_FFWD_) && --timeout);
if (unlikely(timeout == 0))
SMSC_WARNING(HW, "Timed out waiting for "
--
1.6.0.6
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists