summaryrefslogtreecommitdiff
path: root/drivers/watchdog
diff options
context:
space:
mode:
authorBumsik Kim <kbumsik@gmail.com>2020-05-29 10:24:28 +0900
committerWim Van Sebroeck <wim@linux-watchdog.org>2020-08-05 18:42:46 +0200
commit0be01476dd527dfa00976911208332c706a1b752 (patch)
treec90eb995d4f7b6a167263b9dc2690056e5a41a7d /drivers/watchdog
parentd6e6d5627f0aaa16d6b6e94238d62a594a35b5ce (diff)
watchdog: test_bit() => watchdog_active()
Use the dedicated function watchdog_active() instead of the generic test_bit() function. It is done using the following Coccinelle script: @@ identifier wdd; @@ - test_bit(WDOG_ACTIVE, &wdd->status) + watchdog_active(wdd) Signed-off-by: Bumsik Kim <k.bumsik@gmail.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20200529012428.84684-1-k.bumsik@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
Diffstat (limited to 'drivers/watchdog')
-rw-r--r--drivers/watchdog/watchdog_dev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/watchdog/watchdog_dev.c b/drivers/watchdog/watchdog_dev.c
index 7e4cd34a8c20..3ae608d78af2 100644
--- a/drivers/watchdog/watchdog_dev.c
+++ b/drivers/watchdog/watchdog_dev.c
@@ -916,7 +916,7 @@ static int watchdog_release(struct inode *inode, struct file *file)
* or if WDIOF_MAGICCLOSE is not set. If nowayout was set then
* watchdog_stop will fail.
*/
- if (!test_bit(WDOG_ACTIVE, &wdd->status))
+ if (!watchdog_active(wdd))
err = 0;
else if (test_and_clear_bit(_WDOG_ALLOW_RELEASE, &wd_data->status) ||
!(wdd->info->options & WDIOF_MAGICCLOSE))