diff options
author | Roel Kluin <roel.kluin@gmail.com> | 2009-02-03 00:39:02 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-02-03 00:39:02 -0500 |
commit | 46578a6913e6f5e69229561736b94c18c2e88ae4 (patch) | |
tree | 23db22f32e094dd971650528ea1d499bd2ab3015 /drivers/net/smc911x.c | |
parent | 0047e5d240ede4e84c03bc9001375175900fd259 (diff) |
net: variables reach -1, but 0 tested
while (timeout--) { ... }
timeout becomes -1 if the loop isn't ended otherwise, not 0.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/smc911x.c')
-rw-r--r-- | drivers/net/smc911x.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c index bf3aa2a1effe..223cde0d43be 100644 --- a/drivers/net/smc911x.c +++ b/drivers/net/smc911x.c | |||
@@ -220,9 +220,9 @@ static void smc911x_reset(struct net_device *dev) | |||
220 | 220 | ||
221 | /* make sure EEPROM has finished loading before setting GPIO_CFG */ | 221 | /* make sure EEPROM has finished loading before setting GPIO_CFG */ |
222 | timeout=1000; | 222 | timeout=1000; |
223 | while ( timeout-- && (SMC_GET_E2P_CMD(lp) & E2P_CMD_EPC_BUSY_)) { | 223 | while (--timeout && (SMC_GET_E2P_CMD(lp) & E2P_CMD_EPC_BUSY_)) |
224 | udelay(10); | 224 | udelay(10); |
225 | } | 225 | |
226 | if (timeout == 0){ | 226 | if (timeout == 0){ |
227 | PRINTK("%s: smc911x_reset timeout waiting for EEPROM busy\n", dev->name); | 227 | PRINTK("%s: smc911x_reset timeout waiting for EEPROM busy\n", dev->name); |
228 | return; | 228 | return; |