* [PATCH] watchdog: test_bit() => watchdog_active()
@ 2020-05-29 1:24 Bumsik Kim
2020-05-29 16:52 ` Guenter Roeck
0 siblings, 1 reply; 2+ messages in thread
From: Bumsik Kim @ 2020-05-29 1:24 UTC (permalink / raw)
To: wim, linux, corbet; +Cc: linux-kernel, linux-watchdog, Bumsik Kim
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>
---
drivers/watchdog/watchdog_dev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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))
--
2.26.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] watchdog: test_bit() => watchdog_active()
2020-05-29 1:24 [PATCH] watchdog: test_bit() => watchdog_active() Bumsik Kim
@ 2020-05-29 16:52 ` Guenter Roeck
0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2020-05-29 16:52 UTC (permalink / raw)
To: Bumsik Kim; +Cc: wim, corbet, linux-kernel, linux-watchdog, Bumsik Kim
On Fri, May 29, 2020 at 10:24:28AM +0900, Bumsik Kim wrote:
> 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>
> ---
> drivers/watchdog/watchdog_dev.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> 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))
> --
> 2.26.2
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-05-29 16:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-29 1:24 [PATCH] watchdog: test_bit() => watchdog_active() Bumsik Kim
2020-05-29 16:52 ` Guenter Roeck
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).