ll_temac: Fix poll implementation

Submitted by Michal Simek on Aug. 18, 2010, 10:26 a.m.

Details

Message ID 1282127194-4185-1-git-send-email-monstr@monstr.eu
State Accepted
Delegated to: David Miller
Headers show

Commit Message

Michal Simek Aug. 18, 2010, 10:26 a.m.
Functions ll_temac_rx_irq and ll_temac_tx_irq
have pointer to net_device as second parameter not
pointer to temac_local.

Signed-off-by: Michal Simek <monstr@monstr.eu>
---
 drivers/net/ll_temac_main.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Comments

David Miller Aug. 19, 2010, 7:48 a.m.
From: Michal Simek <monstr@monstr.eu>
Date: Wed, 18 Aug 2010 12:26:34 +0200

> Functions ll_temac_rx_irq and ll_temac_tx_irq
> have pointer to net_device as second parameter not
> pointer to temac_local.
> 
> Signed-off-by: Michal Simek <monstr@monstr.eu>

Applied, thanks a lot.

I can't count how many times this kind of error has been
introduced.  It's of cource because the handle passed to
IRQ handlers is an opaque void pointer, so if the underlying
type gets changed there is absolutely no type checking done
against by-hand calls of the IRQ handler.

Rusty Russell was, if I remember correctly, doing some work
to correct this such that IRQ handlers could in fact have
some proper typing in their handlers.  Or maybe that was for
timer handlers?

Anyways that kind of thing would help here.

Rusty?
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Michal Simek Aug. 25, 2010, 12:24 p.m.
David Miller wrote:
> From: Michal Simek <monstr@monstr.eu>
> Date: Wed, 18 Aug 2010 12:26:34 +0200
> 
>> Functions ll_temac_rx_irq and ll_temac_tx_irq
>> have pointer to net_device as second parameter not
>> pointer to temac_local.
>>
>> Signed-off-by: Michal Simek <monstr@monstr.eu>
> 
> Applied, thanks a lot.
> 
> I can't count how many times this kind of error has been
> introduced.  It's of cource because the handle passed to
> IRQ handlers is an opaque void pointer, so if the underlying
> type gets changed there is absolutely no type checking done
> against by-hand calls of the IRQ handler.
> 
> Rusty Russell was, if I remember correctly, doing some work
> to correct this such that IRQ handlers could in fact have
> some proper typing in their handlers.  Or maybe that was for
> timer handlers?
> 
> Anyways that kind of thing would help here.
> 
> Rusty?

Rusty, you there?

Michal

Patch hide | download patch | download mbox

diff --git a/drivers/net/ll_temac_main.c b/drivers/net/ll_temac_main.c
index c7b6247..bdf2149 100644
--- a/drivers/net/ll_temac_main.c
+++ b/drivers/net/ll_temac_main.c
@@ -902,8 +902,8 @@  temac_poll_controller(struct net_device *ndev)
 	disable_irq(lp->tx_irq);
 	disable_irq(lp->rx_irq);
 
-	ll_temac_rx_irq(lp->tx_irq, lp);
-	ll_temac_tx_irq(lp->rx_irq, lp);
+	ll_temac_rx_irq(lp->tx_irq, ndev);
+	ll_temac_tx_irq(lp->rx_irq, ndev);
 
 	enable_irq(lp->tx_irq);
 	enable_irq(lp->rx_irq);