From ebc53cb165ea26aa48f0bbf01d9bce0e4abb0b7d Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Thu, 5 Dec 2019 17:04:29 -0800 Subject: app/watchdog: Always use resetTimeRemaining The SetWatchdog function currently sets the intervals and then the time remaining on the watchdog. It uses the user provided interval for both values. Recently, the watchdog was extended to allow for the interval to be capped above a certain value to prevent the user from setting watchdogs that are known to be too short. In order to keep the timeRemaining in sync with the value in the watchdog, just use the resetTimeRemaining() function which reads the current interval to set the timeRemaining. Change-Id: I3f15030a85c625fcb1ed8040add03496618a5ece Signed-off-by: William A. Kennington III --- app/watchdog.cpp | 2 +- app/watchdog_service.cpp | 5 ----- app/watchdog_service.hpp | 7 ------- 3 files changed, 1 insertion(+), 13 deletions(-) diff --git a/app/watchdog.cpp b/app/watchdog.cpp index f97c45b..cb71115 100644 --- a/app/watchdog.cpp +++ b/app/watchdog.cpp @@ -247,7 +247,7 @@ ipmi::RspType<> // Set the new interval and the time remaining deci -> mill seconds const uint64_t interval = initialCountdown * 100; wd_service.setInterval(interval); - wd_service.setTimeRemaining(interval); + wd_service.resetTimeRemaining(false); // Mark as initialized so that future resets behave correctly wd_service.setInitialized(true); diff --git a/app/watchdog_service.cpp b/app/watchdog_service.cpp index a929cb6..3534e89 100644 --- a/app/watchdog_service.cpp +++ b/app/watchdog_service.cpp @@ -198,8 +198,3 @@ void WatchdogService::setInterval(uint64_t interval) { setProperty("Interval", interval); } - -void WatchdogService::setTimeRemaining(uint64_t timeRemaining) -{ - setProperty("TimeRemaining", timeRemaining); -} diff --git a/app/watchdog_service.hpp b/app/watchdog_service.hpp index ed64a3c..141bdb7 100644 --- a/app/watchdog_service.hpp +++ b/app/watchdog_service.hpp @@ -92,13 +92,6 @@ class WatchdogService */ void setInterval(uint64_t interval); - /** @brief Sets the value of the timeRemaining property on the host - * watchdog - * - * @param[in] timeRemaining - The new timeRemaining value - */ - void setTimeRemaining(uint64_t timeRemaining); - private: /** @brief sdbusplus handle */ sdbusplus::bus::bus bus; -- cgit v1.2.1