r8169: simplify interrupt handler
authorHeiner Kallweit <hkallweit1@gmail.com>
Fri, 10 Aug 2018 20:38:29 +0000 (22:38 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 10 Aug 2018 21:32:35 +0000 (14:32 -0700)
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>
drivers/net/ethernet/realtek/r8169.c

index 7f0975b61c53d9d2ef9ab47ec0c062fe35142f0a..fc6ae446816d275eb36bff0195c05128f07e0a64 100644 (file)
@@ -6520,20 +6520,15 @@ release_descriptor:
 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;
 }
 
 /*