* [PATCH] cassini: limit reaches -1
@ 2009-01-31 15:08 Roel Kluin
0 siblings, 0 replies; only message in thread
From: Roel Kluin @ 2009-01-31 15:08 UTC (permalink / raw)
To: netdev
With a postfix decrement limit reaches -1, but on 0
the function already returns false.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/drivers/net/cassini.c b/drivers/net/cassini.c
index 840b3d1..bbbc3bb 100644
--- a/drivers/net/cassini.c
+++ b/drivers/net/cassini.c
@@ -806,7 +806,7 @@ static int cas_reset_mii_phy(struct cas *cp)
cas_phy_write(cp, MII_BMCR, BMCR_RESET);
udelay(100);
- while (limit--) {
+ while (--limit) {
val = cas_phy_read(cp, MII_BMCR);
if ((val & BMCR_RESET) == 0)
break;
@@ -979,7 +979,7 @@ static void cas_phy_init(struct cas *cp)
writel(val, cp->regs + REG_PCS_MII_CTRL);
limit = STOP_TRIES;
- while (limit-- > 0) {
+ while (--limit > 0) {
udelay(10);
if ((readl(cp->regs + REG_PCS_MII_CTRL) &
PCS_MII_RESET) == 0)
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2009-01-31 15:08 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-31 15:08 [PATCH] cassini: limit reaches -1 Roel Kluin
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).