]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commit
net pcmcia: worklimit reaches -1
authorRoel Kluin <roel.kluin@gmail.com>
Wed, 4 Mar 2009 08:05:56 +0000 (00:05 -0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 4 Mar 2009 08:11:52 +0000 (00:11 -0800)
commitb9bdcd9bd78d253dcc8e13c29f0acd67e080e7c1
tree6ee1908315df4e2347c16eb63fee6bd2762a749b
parent858b9ced6e73a0f087294c398a1ae70a7eeed94f
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>
drivers/net/pcmcia/3c574_cs.c
drivers/net/pcmcia/3c589_cs.c