From 93890321c566bc24b5614a850b59eedc41c9bfb6 Mon Sep 17 00:00:00 2001 From: ouyangxiangzhen Date: Thu, 10 Oct 2024 09:23:05 +0800 Subject: [PATCH] sched/wdog: Fix code style This commit fixed code style issue left by the previous patch. Signed-off-by: ouyangxiangzhen --- sched/wdog/wd_cancel.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sched/wdog/wd_cancel.c b/sched/wdog/wd_cancel.c index 858d07eacb..3cfc960e8f 100644 --- a/sched/wdog/wd_cancel.c +++ b/sched/wdog/wd_cancel.c @@ -91,6 +91,10 @@ int wd_cancel(FAR struct wdog_s *wdog) int wd_cancel_irq(FAR struct wdog_s *wdog) { + bool head; + + /* Make sure that the watchdog is valid and still active. */ + if (wdog == NULL || !WDOG_ISACTIVE(wdog)) { return -EINVAL; @@ -103,9 +107,7 @@ int wd_cancel_irq(FAR struct wdog_s *wdog) * cancellation is complete */ - /* Make sure that the watchdog is still active. */ - - bool head = list_is_head(&g_wdactivelist, &wdog->node); + head = list_is_head(&g_wdactivelist, &wdog->node); /* Now, remove the watchdog from the timer queue */