aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers
diff options
context:
space:
mode:
authorHeiner Kallweit <hkallweit1@gmail.com>2020-03-22 19:03:06 +0100
committerDavid S. Miller <davem@davemloft.net>2020-03-23 21:38:21 -0700
commit3f6ca6c739892ed018bc17100efa4703fcc8af46 (patch)
tree85c6fc7730150aa68b031f46e1ebb5fde82276e3 /drivers
parentr8169: simplify rtl_task (diff)
downloadwireguard-linux-3f6ca6c739892ed018bc17100efa4703fcc8af46.tar.xz
wireguard-linux-3f6ca6c739892ed018bc17100efa4703fcc8af46.zip
r8169: improve rtl_schedule_task
The current implementation makes the implicit assumption that if a bit is set, then the work is scheduled already. Remove the need for this implicit assumption and call schedule_work() always. It will check internally whether the work is scheduled already. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/realtek/r8169_main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
index 242b14cc7131..e9ced0360f58 100644
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -2228,8 +2228,8 @@ u16 rtl8168h_2_get_adc_bias_ioffset(struct rtl8169_private *tp)
static void rtl_schedule_task(struct rtl8169_private *tp, enum rtl_flag flag)
{
- if (!test_and_set_bit(flag, tp->wk.flags))
- schedule_work(&tp->wk.work);
+ set_bit(flag, tp->wk.flags);
+ schedule_work(&tp->wk.work);
}
static void rtl8169_init_phy(struct rtl8169_private *tp)