linux-mips
[Top] [All Lists]

Re: [PATCH RESEND 15/17] NET: MIPS: lantiq: return value of request_irq

To: John Crispin <blogic@openwrt.org>
Subject: Re: [PATCH RESEND 15/17] NET: MIPS: lantiq: return value of request_irq was not handled gracefully
From: Sergei Shtylyov <sshtylyov@mvista.com>
Date: Thu, 12 Jan 2012 15:33:55 +0400
Cc: Ralf Baechle <ralf@linux-mips.org>, linux-mips@linux-mips.org
In-reply-to: <1326314674-9899-15-git-send-email-blogic@openwrt.org>
References: <1326314674-9899-1-git-send-email-blogic@openwrt.org> <1326314674-9899-15-git-send-email-blogic@openwrt.org>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:9.0) Gecko/20111222 Thunderbird/9.0.1
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@openwrt.org>
Acked-by: David S. Miller<davem@davemloft.net>
---
  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

<Prev in Thread] Current Thread [Next in Thread>