From ff01b9163655ace76b29b7ff2f56b25c32f795da Mon Sep 17 00:00:00 2001 From: Roel Kluin Date: Mon, 2 Feb 2009 23:19:50 -0800 Subject: cassini/sungem: limit reaches -1, but 0 tested while (limit--) if (test()) break; if (limit <= 0) goto test_failed; In the last iteration, limit is decremented after the test to 0. If just thereafter test() succeeds and a break occurs, the goto still occurs because limit is 0. Signed-off-by: Roel Kluin Signed-off-by: David S. Miller --- drivers/net/sungem_phy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/net/sungem_phy.c') 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; -- cgit v1.1