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 <peng.fan@nxp.com>
Link: https://patch.msgid.link/20260918141915.3023207-1-peng.fan@oss.nxp.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
This commit is contained in:
Peng Fan 2026-09-18 22:19:14 +08:00 committed by Guenter Roeck
parent b2937ea44b
commit 07c03fc1d0

View File

@ -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)) {