Commit e18958c6 authored by Heiner Kallweit's avatar Heiner Kallweit Committed by David S. Miller

r8169: simplify rtl_task

Currently rtl_task() is designed to handle a large number of tasks.
However we have just one, so we can remove some overhead.
Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent aba53204
...@@ -4589,31 +4589,17 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance) ...@@ -4589,31 +4589,17 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance)
static void rtl_task(struct work_struct *work) static void rtl_task(struct work_struct *work)
{ {
static const struct {
int bitnr;
void (*action)(struct rtl8169_private *);
} rtl_work[] = {
{ RTL_FLAG_TASK_RESET_PENDING, rtl_reset_work },
};
struct rtl8169_private *tp = struct rtl8169_private *tp =
container_of(work, struct rtl8169_private, wk.work); container_of(work, struct rtl8169_private, wk.work);
struct net_device *dev = tp->dev;
int i;
rtl_lock_work(tp); rtl_lock_work(tp);
if (!netif_running(dev) || if (!netif_running(tp->dev) ||
!test_bit(RTL_FLAG_TASK_ENABLED, tp->wk.flags)) !test_bit(RTL_FLAG_TASK_ENABLED, tp->wk.flags))
goto out_unlock; goto out_unlock;
for (i = 0; i < ARRAY_SIZE(rtl_work); i++) { if (test_and_clear_bit(RTL_FLAG_TASK_RESET_PENDING, tp->wk.flags))
bool pending; rtl_reset_work(tp);
pending = test_and_clear_bit(rtl_work[i].bitnr, tp->wk.flags);
if (pending)
rtl_work[i].action(tp);
}
out_unlock: out_unlock:
rtl_unlock_work(tp); rtl_unlock_work(tp);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment