diff options
author | Roel Kluin <12o3l@tiscali.nl> | 2008-04-18 13:50:48 -0700 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-04-25 02:08:55 -0400 |
commit | db2961c5a13562503c82ae306af269fde4fea8f0 (patch) | |
tree | fe08d96d6be9245009dba0e6b47aef04502167fb /drivers/net/smc911x.c | |
parent | 72abb46101fb5c47a9592914adb221b430ff26bd (diff) | |
download | kernel_samsung_smdk4412-db2961c5a13562503c82ae306af269fde4fea8f0.zip kernel_samsung_smdk4412-db2961c5a13562503c82ae306af269fde4fea8f0.tar.gz kernel_samsung_smdk4412-db2961c5a13562503c82ae306af269fde4fea8f0.tar.bz2 |
smc911x: test after postfix decrement fails in smc911x_{reset,drop_pkt}
When timeout reaches 0 the postfix decrement still subtracts, so the test
fails.
[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
Acked-by: Peter Korsgaard <jacmet@sunsite.dk>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/smc911x.c')
-rw-r--r-- | drivers/net/smc911x.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c index 8fbc08b..4e28002 100644 --- a/drivers/net/smc911x.c +++ b/drivers/net/smc911x.c @@ -244,7 +244,7 @@ static void smc911x_reset(struct net_device *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; @@ -268,7 +268,7 @@ static void smc911x_reset(struct net_device *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); @@ -414,7 +414,7 @@ static inline void smc911x_drop_pkt(struct net_device *dev) 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); } |