Hello. On 12-01-2012 0:44, John Crispin wrote:
The return values of request_irq() were not checked leading to the following error message.
drivers/net/ethernet/lantiq_etop.c: In function 'ltq_etop_hw_init': drivers/net/ethernet/lantiq_etop.c:368:15: warning: ignoring return value of 'request_irq', declared with attribute warn_unused_result drivers/net/ethernet/lantiq_etop.c:377:15: warning: ignoring return value of 'request_irq', declared with attribute warn_unused_result
Signed-off-by: John Crispin<blogic@xxxxxxxxxxx> Acked-by: David S. Miller<davem@xxxxxxxxxxxxx> --- drivers/net/ethernet/lantiq_etop.c | 14 ++++++++------ 1 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/lantiq_etop.c b/drivers/net/ethernet/lantiq_etop.c index 9fd6779..659c868 100644 --- a/drivers/net/ethernet/lantiq_etop.c +++ b/drivers/net/ethernet/lantiq_etop.c
[...]
@@ -364,21 +365,22 @@ ltq_etop_hw_init(struct net_device *dev) if (IS_TX(i)) { ltq_dma_alloc_tx(&ch->dma); - request_irq(irq, ltq_etop_dma_irq, IRQF_DISABLED, + err = request_irq(irq, ltq_etop_dma_irq, 0, "etop_tx", priv); } else if (IS_RX(i)) { ltq_dma_alloc_rx(&ch->dma); for (ch->dma.desc = 0; ch->dma.desc< LTQ_DESC_NUM; ch->dma.desc++) if (ltq_etop_alloc_skb(ch)) - return -ENOMEM; + err = -ENOMEM;
This 'err' will get overwrtitten by subseuent request_irq().
ch->dma.desc = 0; - request_irq(irq, ltq_etop_dma_irq, IRQF_DISABLED, + err = request_irq(irq, ltq_etop_dma_irq, 0, "etop_rx", priv); } - ch->dma.irq = irq; + if (!err) + ch->dma.irq = irq; } - return 0; + return err; }
WBR, Sergei