Fix some timeout off by one errors so the logic works
as intended.

Signed-off-by: Jason Borg <[EMAIL PROTECTED]>
---

diff -uprN linux-2.6.18-rc4-orig/drivers/net/smc911x.c 
linux-2.6.18-rc4/drivers/net/smc911x.c
--- linux-2.6.18-rc4-orig/drivers/net/smc911x.c 2006-08-22 15:49:20.573284797 
-0400
+++ linux-2.6.18-rc4/drivers/net/smc911x.c      2006-08-22 15:50:37.049536155 
-0400
@@ -251,7 +251,7 @@ static void smc911x_reset(struct net_dev
                do {
                        udelay(10);
                        reg = SMC_GET_PMT_CTRL() & PMT_CTRL_READY_;
-               } while ( timeout-- && !reg);
+               } while ( --timeout && !reg);
                if (timeout == 0) {
                        PRINTK("%s: smc911x_reset timeout waiting for PM 
restore\n", dev->name);
                        return;
@@ -275,7 +275,7 @@ static void smc911x_reset(struct net_dev
                                resets++;
                                break;
                        }
-               } while ( timeout-- && (reg & HW_CFG_SRST_));
+               } while ( --timeout && (reg & HW_CFG_SRST_));
        }
        if (timeout == 0) {
                PRINTK("%s: smc911x_reset timeout waiting for reset\n", 
dev->name);
@@ -421,7 +421,7 @@ static inline void smc911x_drop_pkt(stru
                do {
                        udelay(10);
                        reg = SMC_GET_RX_DP_CTRL() & RX_DP_CTRL_FFWD_BUSY_;
-               } while ( timeout-- && reg);
+               } while ( --timeout && reg);
                if (timeout == 0) {
                        PRINTK("%s: timeout waiting for RX fast forward\n", 
dev->name);
                }


-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to