From: Mark Einon Date: Wed, 3 Sep 2014 21:40:54 +0000 (+0100) Subject: staging: et131x: Remove dead code in isr X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=be40a261aa52912b3e708e34383f0f0afb10d212;p=openwrt%2Fstaging%2Fblogic.git staging: et131x: Remove dead code in isr Dan Carpenter reports: The patch c2ebf58ba089: "staging: et131x: Implement NAPI support" from Aug 21, 2014, leads to the following static checker warning: drivers/staging/et131x/et131x.c:4004 et131x_isr() warn: we tested 'status' before and it was 'true' We don't actually need the dead code, as we're now using NAPI to handle enabling interrupts - but we do need to enable interrupts if NAPI is not scheduled - so enable interrupts if this is the case. Reported-by: Dan Carpenter Signed-off-by: Mark Einon Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/et131x/et131x.c b/drivers/staging/et131x/et131x.c index 1037d931d0e6..7a1df8a3016e 100644 --- a/drivers/staging/et131x/et131x.c +++ b/drivers/staging/et131x/et131x.c @@ -3793,6 +3793,7 @@ static SIMPLE_DEV_PM_OPS(et131x_pm_ops, et131x_suspend, et131x_resume); static irqreturn_t et131x_isr(int irq, void *dev_id) { bool handled = true; + bool enable_interrupts = true; struct net_device *netdev = (struct net_device *)dev_id; struct et131x_adapter *adapter = netdev_priv(netdev); struct address_map __iomem *iomem = adapter->regs; @@ -3802,6 +3803,7 @@ static irqreturn_t et131x_isr(int irq, void *dev_id) if (!netif_device_present(netdev)) { handled = false; + enable_interrupts = false; goto out; } @@ -3847,8 +3849,10 @@ static irqreturn_t et131x_isr(int irq, void *dev_id) status &= ~ET_INTR_WATCHDOG; } - if (status & (ET_INTR_RXDMA_XFR_DONE | ET_INTR_TXDMA_ISR)) + if (status & (ET_INTR_RXDMA_XFR_DONE | ET_INTR_TXDMA_ISR)) { + enable_interrupts = false; napi_schedule(&adapter->napi); + } status &= ~(ET_INTR_TXDMA_ISR | ET_INTR_RXDMA_XFR_DONE); @@ -4001,16 +4005,10 @@ static irqreturn_t et131x_isr(int irq, void *dev_id) */ } - if (!status) { - /* This interrupt has in some way been "handled" by - * the ISR. Either it was a spurious Rx interrupt, or - * it was a Tx interrupt that has been filtered by - * the ISR. - */ +out: + if (enable_interrupts) et131x_enable_interrupts(adapter); - } -out: return IRQ_RETVAL(handled); } @@ -4257,7 +4255,7 @@ static void et131x_multicast(struct net_device *netdev) } /* et131x_tx - The handler to tx a packet on the device */ -static int et131x_tx(struct sk_buff *skb, struct net_device *netdev) +static netdev_tx_t et131x_tx(struct sk_buff *skb, struct net_device *netdev) { int status = 0; struct et131x_adapter *adapter = netdev_priv(netdev);