Skip to content

Commit

Permalink
r8169: simplify interrupt handler
Browse files Browse the repository at this point in the history
Simplify the interrupt handler a little and make it better readable.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Heiner Kallweit authored and David S. Miller committed Aug 10, 2018
1 parent 098b01a commit 05bbe55
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions drivers/net/ethernet/realtek/r8169.c
Original file line number Diff line number Diff line change
Expand Up @@ -6520,20 +6520,15 @@ static int rtl_rx(struct net_device *dev, struct rtl8169_private *tp, u32 budget
static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance)
{
struct rtl8169_private *tp = dev_instance;
int handled = 0;
u16 status;
u16 status = rtl_get_events(tp);

status = rtl_get_events(tp);
if (status && status != 0xffff) {
status &= RTL_EVENT_NAPI | tp->event_slow;
if (status) {
handled = 1;
if (status == 0xffff || !(status & (RTL_EVENT_NAPI | tp->event_slow)))
return IRQ_NONE;

rtl_irq_disable(tp);
napi_schedule_irqoff(&tp->napi);
}
}
return IRQ_RETVAL(handled);
rtl_irq_disable(tp);
napi_schedule_irqoff(&tp->napi);

return IRQ_HANDLED;
}

/*
Expand Down

0 comments on commit 05bbe55

Please sign in to comment.