[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1448825331-28840-6-git-send-email-linux@roeck-us.net>
Date: Sun, 29 Nov 2015 11:28:47 -0800
From: Guenter Roeck <linux@...ck-us.net>
To: linux-watchdog@...r.kernel.org
Cc: Wim Van Sebroeck <wim@...ana.be>, linux-kernel@...r.kernel.org,
Timo Kokkonen <timo.kokkonen@...code.fi>,
Uwe Kleine-König
<u.kleine-koenig@...gutronix.de>, linux-doc@...r.kernel.org,
Doug Anderson <dianders@...omium.org>,
Jonathan Corbet <corbet@....net>,
Guenter Roeck <linux@...ck-us.net>
Subject: [PATCH v6 5/9] watchdog: Simplify update_worker
Drop 'cancel' parameter; simply cancel worker unconditionally
if not needed.
Signed-off-by: Guenter Roeck <linux@...ck-us.net>
---
v6: Rebased to v4.4-rc2
v5: Introduced patch
---
drivers/watchdog/watchdog_dev.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/drivers/watchdog/watchdog_dev.c b/drivers/watchdog/watchdog_dev.c
index 82706d43e0c8..be65b388e277 100644
--- a/drivers/watchdog/watchdog_dev.c
+++ b/drivers/watchdog/watchdog_dev.c
@@ -96,15 +96,14 @@ static long watchdog_next_keepalive(struct watchdog_device *wdd)
return min_t(long, last_heartbeat - jiffies, keepalive_interval);
}
-static inline void watchdog_update_worker(struct watchdog_device *wdd,
- bool cancel)
+static inline void watchdog_update_worker(struct watchdog_device *wdd)
{
if (watchdog_need_worker(wdd)) {
long t = watchdog_next_keepalive(wdd);
if (t > 0)
mod_delayed_work(watchdog_wq, &wdd->work, t);
- } else if (cancel) {
+ } else {
cancel_delayed_work(&wdd->work);
}
}
@@ -133,7 +132,7 @@ static int _watchdog_ping(struct watchdog_device *wdd)
else
err = wdd->ops->start(wdd); /* restart watchdog */
- watchdog_update_worker(wdd, false);
+ watchdog_update_worker(wdd);
return err;
}
@@ -200,7 +199,7 @@ static int watchdog_start(struct watchdog_device *wdd)
if (err == 0) {
set_bit(WDOG_ACTIVE, &wdd->status);
wdd->last_keepalive = started_at;
- watchdog_update_worker(wdd, true);
+ watchdog_update_worker(wdd);
}
out_start:
@@ -245,7 +244,7 @@ static int watchdog_stop(struct watchdog_device *wdd)
if (err == 0) {
clear_bit(WDOG_ACTIVE, &wdd->status);
- watchdog_update_worker(wdd, true);
+ watchdog_update_worker(wdd);
}
out_stop:
@@ -313,7 +312,7 @@ static int watchdog_set_timeout(struct watchdog_device *wdd,
else
wdd->timeout = timeout;
- watchdog_update_worker(wdd, true);
+ watchdog_update_worker(wdd);
out_timeout:
mutex_unlock(&wdd->lock);
@@ -592,7 +591,7 @@ static int watchdog_release(struct inode *inode, struct file *file)
}
cancel_delayed_work_sync(&wdd->work);
- watchdog_update_worker(wdd, false);
+ watchdog_update_worker(wdd);
/*
* Allow the owner module to be unloaded again unless the watchdog
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists