Commit 0be01476 authored by Bumsik Kim's avatar Bumsik Kim Committed by Wim Van Sebroeck

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: default avatarBumsik Kim <k.bumsik@gmail.com>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20200529012428.84684-1-k.bumsik@gmail.comSigned-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarWim Van Sebroeck <wim@linux-watchdog.org>
parent d6e6d562
...@@ -916,7 +916,7 @@ static int watchdog_release(struct inode *inode, struct file *file) ...@@ -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 * or if WDIOF_MAGICCLOSE is not set. If nowayout was set then
* watchdog_stop will fail. * watchdog_stop will fail.
*/ */
if (!test_bit(WDOG_ACTIVE, &wdd->status)) if (!watchdog_active(wdd))
err = 0; err = 0;
else if (test_and_clear_bit(_WDOG_ALLOW_RELEASE, &wd_data->status) || else if (test_and_clear_bit(_WDOG_ALLOW_RELEASE, &wd_data->status) ||
!(wdd->info->options & WDIOF_MAGICCLOSE)) !(wdd->info->options & WDIOF_MAGICCLOSE))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment