netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sungem: limit reaches -1, but 0 tested
@ 2009-01-31 12:42 Roel Kluin
  2009-02-01  9:59 ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Roel Kluin @ 2009-01-31 12:42 UTC (permalink / raw)
  To: netdev, lkml

With a postfix decrement these reach -1 rather than 0,
but after the loop it is tested to have become 0.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/drivers/net/sungem_phy.c b/drivers/net/sungem_phy.c
index 61843fd..78f8cee 100644
--- a/drivers/net/sungem_phy.c
+++ b/drivers/net/sungem_phy.c
@@ -79,7 +79,7 @@ static int reset_one_mii_phy(struct mii_phy* phy, int phy_id)
 
 	udelay(100);
 
-	while (limit--) {
+	while (--limit) {
 		val = __phy_read(phy, phy_id, MII_BMCR);
 		if ((val & BMCR_RESET) == 0)
 			break;

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-02-03  7:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-31 12:42 [PATCH] sungem: limit reaches -1, but 0 tested Roel Kluin
2009-02-01  9:59 ` David Miller
2009-02-01 17:15   ` Roel Kluin
2009-02-03  7:19     ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).