From c159c1fa35329eca92db26140a589f22e7d6811f Mon Sep 17 00:00:00 2001 From: Tomasz Leman Date: Tue, 9 Apr 2024 10:48:43 +0200 Subject: [PATCH] init: Refactor check_restore to return bool This patch refactors the `check_restore` function to return a `bool` instead of an `int`. This change enhances code readability and clarifies the intent of the function, which is to return a true or false value based on the presence of core structures in memory. No functional changes are introduced by this patch; it is purely a code quality improvement. Signed-off-by: Tomasz Leman --- src/init/init.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/init/init.c b/src/init/init.c index 86049d8b6..dba599661 100644 --- a/src/init/init.c +++ b/src/init/init.c @@ -89,7 +89,7 @@ static inline void lp_sram_unpack(void) #ifndef __ZEPHYR__ -static int check_restore(void) +static bool check_restore(void) { struct idc *idc = *idc_get(); struct task *task = *task_main_get(); @@ -100,10 +100,7 @@ static int check_restore(void) * are available in memory, it means that this is not cold boot and memory * has not been powered off. */ - if (!idc || !task || !notifier || !schedulers) - return 0; - - return 1; + return !!idc && !!task && !!notifier && !!schedulers; } static int secondary_core_restore(void)