From 18284f5a1beccae9cce357a1eed7cdf77348cddb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Fri, 20 Dec 2024 14:31:49 +0100 Subject: [PATCH] core: drop duplicated check in manager_{set,override}_watchdog Those functions call watchdog_setup() and watchdog_setup_pretimeout(), which internally do a similar check against the static variables watchdog_timeout and watchdog_pretimeout. The second check is not useful. --- src/core/manager.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/core/manager.c b/src/core/manager.c index c6c97799763..12c4e65e520 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -3582,9 +3582,6 @@ void manager_set_watchdog(Manager *m, WatchdogType t, usec_t timeout) { if (MANAGER_IS_USER(m)) return; - if (m->watchdog[t] == timeout) - return; - if (m->watchdog_overridden[t] == USEC_INFINITY) { if (t == WATCHDOG_RUNTIME) (void) watchdog_setup(timeout); @@ -3603,9 +3600,6 @@ void manager_override_watchdog(Manager *m, WatchdogType t, usec_t timeout) { if (MANAGER_IS_USER(m)) return; - if (m->watchdog_overridden[t] == timeout) - return; - usec = timeout == USEC_INFINITY ? m->watchdog[t] : timeout; if (t == WATCHDOG_RUNTIME) (void) watchdog_setup(usec); -- 2.47.3