diff options
author | Roel Kluin <roel.kluin@gmail.com> | 2009-03-04 09:05:56 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-03-04 09:11:52 +0100 |
commit | b9bdcd9bd78d253dcc8e13c29f0acd67e080e7c1 (patch) | |
tree | 6ee1908315df4e2347c16eb63fee6bd2762a749b /drivers/net/pcmcia/3c574_cs.c | |
parent | net: more timeouts that reach -1 (diff) | |
download | linux-b9bdcd9bd78d253dcc8e13c29f0acd67e080e7c1.tar.xz linux-b9bdcd9bd78d253dcc8e13c29f0acd67e080e7c1.zip |
net pcmcia: worklimit reaches -1
with while (--worklimit >= 0); worklimit reaches -1 after the loop. In
3c589_cs.c this caused a warning not to be printed.
In 3c574_cs.c contrastingly, el3_rx() treats worklimit differently:
static int el3_rx(struct net_device *dev, int worklimit)
{
while (--worklimit >= 0) { ... }
return worklimit;
}
el3_rx() is only called by function el3_interrupt(): twice:
static irqreturn_t el3_interrupt(int irq, void *dev_id)
{
int work_budget = max_interrupt_work;
while(...) {
if (...)
work_budget = el3_rx(dev, work_budget);
if (...)
work_budget = el3_rx(dev, work_budget);
if (--work_budget < 0) {
...
break;
}
}
}
The error path can occur 2 too early.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/pcmcia/3c574_cs.c')
-rw-r--r-- | drivers/net/pcmcia/3c574_cs.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c index e5cb6b1f0ebd..2404a838b1fe 100644 --- a/drivers/net/pcmcia/3c574_cs.c +++ b/drivers/net/pcmcia/3c574_cs.c @@ -1035,7 +1035,8 @@ static int el3_rx(struct net_device *dev, int worklimit) DEBUG(3, "%s: in rx_packet(), status %4.4x, rx_status %4.4x.\n", dev->name, inw(ioaddr+EL3_STATUS), inw(ioaddr+RxStatus)); while (!((rx_status = inw(ioaddr + RxStatus)) & 0x8000) && - (--worklimit >= 0)) { + worklimit > 0) { + worklimit--; if (rx_status & 0x4000) { /* Error, update stats. */ short error = rx_status & 0x3800; dev->stats.rx_errors++; |