staging: unisys: correctly handle return value from queue_delayed_work()
authorBenjamin Romer <benjamin.romer@unisys.com>
Thu, 1 Oct 2015 15:52:30 +0000 (11:52 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 Oct 2015 09:37:53 +0000 (11:37 +0200)
Properly handle the return value from queue_delayed_work() - it's a
bool, not an int, so using a less than comparison isn't appropriate.

This mistake was found by David Binderman <dcb314@hotmail.com>.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/unisys/visorbus/periodic_work.c

index a3631c3591f61cc088479ae90563e5e1f88752ff..115b7aa9560a8a1c231c27c22f6cfc134f5d1550 100644 (file)
@@ -86,8 +86,8 @@ bool visor_periodic_work_nextperiod(struct periodic_work *pw)
                pw->want_to_stop = false;
                rc = true;  /* yes, true; see visor_periodic_work_stop() */
                goto unlock;
-       } else if (queue_delayed_work(pw->workqueue, &pw->work,
-                                     pw->jiffy_interval) < 0) {
+       } else if (!queue_delayed_work(pw->workqueue, &pw->work,
+                                      pw->jiffy_interval)) {
                pw->is_scheduled = false;
                rc = false;
                goto unlock;
@@ -117,8 +117,8 @@ bool visor_periodic_work_start(struct periodic_work *pw)
                goto unlock;
        }
        INIT_DELAYED_WORK(&pw->work, &periodic_work_func);
-       if (queue_delayed_work(pw->workqueue, &pw->work,
-                              pw->jiffy_interval) < 0) {
+       if (!queue_delayed_work(pw->workqueue, &pw->work,
+                               pw->jiffy_interval)) {
                rc = false;
                goto unlock;
        }
This page took 0.025814 seconds and 5 git commands to generate.