[PATCH] watchdog: use assign_bit() where applicable

Peng Fan (OSS) posted 1 patch 6 days, 8 hours ago
drivers/watchdog/watchdog_core.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
[PATCH] watchdog: use assign_bit() where applicable
Posted by Peng Fan (OSS) 6 days, 8 hours ago
From: Peng Fan <peng.fan@nxp.com>

Convert open-coded if/else with set_bit/clear_bit and their
non-atomic __set_bit/__clear_bit variants to the assign_bit/__assign_bit
API.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 drivers/watchdog/watchdog_core.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/watchdog/watchdog_core.c b/drivers/watchdog/watchdog_core.c
index 38c1e63a8e2c..2948fe52e093 100644
--- a/drivers/watchdog/watchdog_core.c
+++ b/drivers/watchdog/watchdog_core.c
@@ -314,10 +314,7 @@ static int ___watchdog_register_device(struct watchdog_device *wdd)
 
 	/* Module parameter to force watchdog policy on reboot. */
 	if (stop_on_reboot != -1) {
-		if (stop_on_reboot)
-			set_bit(WDOG_STOP_ON_REBOOT, &wdd->status);
-		else
-			clear_bit(WDOG_STOP_ON_REBOOT, &wdd->status);
+		assign_bit(WDOG_STOP_ON_REBOOT, &wdd->status, stop_on_reboot);
 	}
 
 	if (test_bit(WDOG_STOP_ON_REBOOT, &wdd->status)) {
-- 
2.51.0
Re: [PATCH] watchdog: use assign_bit() where applicable
Posted by Guenter Roeck 6 days, 7 hours ago
On Fri, Sep 18, 2026 at 10:19:14PM +0800, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
> 
> Convert open-coded if/else with set_bit/clear_bit and their
> non-atomic __set_bit/__clear_bit variants to the assign_bit/__assign_bit
> API.
> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>

Applied.

Thanks,
Guenter