aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/et131x/et131x.c
diff options
context:
space:
mode:
authorMark Einon <mark.einon@gmail.com>2014-09-03 22:40:54 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-09-08 13:47:00 -0700
commitbe40a261aa52912b3e708e34383f0f0afb10d212 (patch)
tree8896b86d234ebaff62c20c7d18f7e226d063ed7e /drivers/staging/et131x/et131x.c
parentStaging: rtl8821ae: hal_bt_coexist: add a blank newline (diff)
downloadlinux-dev-be40a261aa52912b3e708e34383f0f0afb10d212.tar.xz
linux-dev-be40a261aa52912b3e708e34383f0f0afb10d212.zip
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 <dan.carpenter@oracle.com> Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/et131x/et131x.c')
-rw-r--r--drivers/staging/et131x/et131x.c18
1 files changed, 8 insertions, 10 deletions
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);