From 07c03fc1d077ebac5427dbb9b888e0b2944b61a2 Mon Sep 17 00:00:00 2001 From: Peng Fan Date: Fri, 18 Sep 2026 22:19:14 +0800 Subject: [PATCH] watchdog: use assign_bit() where applicable 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 Link: https://patch.msgid.link/20260918141915.3023207-1-peng.fan@oss.nxp.com Signed-off-by: Guenter Roeck --- 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)) {