mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
smc911x: test after postfix decrement fails in smc911x_{reset,drop_pkt}
When timeout reaches 0 the postfix decrement still subtracts, so the test fails. [[email protected]: coding-style fixes] Signed-off-by: Roel Kluin <[email protected]> Acked-by: Peter Korsgaard <[email protected]> Cc: Jeff Garzik <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Jeff Garzik <[email protected]>
This commit is contained in:
parent
72abb46101
commit
db2961c5a1
1 changed files with 3 additions and 3 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue