]> Pileus Git - ~andy/linux/blobdiff - net/core/link_watch.c
Merge remote-tracking branch 'regulator/fix/doc' into tmp
[~andy/linux] / net / core / link_watch.c
index a01922219a23da6cbd23f5506b2b5ce329b2f617..8f82a5cc3851d3a61953a6cad926c9040bc770a7 100644 (file)
@@ -128,22 +128,13 @@ static void linkwatch_schedule_work(int urgent)
                delay = 0;
 
        /*
-        * This is true if we've scheduled it immeditately or if we don't
-        * need an immediate execution and it's already pending.
+        * If urgent, schedule immediate execution; otherwise, don't
+        * override the existing timer.
         */
-       if (schedule_delayed_work(&linkwatch_work, delay) == !delay)
-               return;
-
-       /* Don't bother if there is nothing urgent. */
-       if (!test_bit(LW_URGENT, &linkwatch_flags))
-               return;
-
-       /* It's already running which is good enough. */
-       if (!__cancel_delayed_work(&linkwatch_work))
-               return;
-
-       /* Otherwise we reschedule it again for immediate execution. */
-       schedule_delayed_work(&linkwatch_work, 0);
+       if (test_bit(LW_URGENT, &linkwatch_flags))
+               mod_delayed_work(system_wq, &linkwatch_work, 0);
+       else
+               schedule_delayed_work(&linkwatch_work, delay);
 }