From 2b02843ca39133a6213e207524f376212196c4fe Mon Sep 17 00:00:00 2001 From: Flavio Ceolin Date: Thu, 5 May 2022 20:46:47 -0700 Subject: [PATCH] pm: Remove unnecessary goto In pm_system_suspend there is a goto label that is supposed to be used to do cleanup before exit the function but it is not doing anything right now. Just remove it. Signed-off-by: Flavio Ceolin --- subsys/pm/pm.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/subsys/pm/pm.c b/subsys/pm/pm.c index 91e28b6c0b4..65b1cdb9c61 100644 --- a/subsys/pm/pm.c +++ b/subsys/pm/pm.c @@ -198,7 +198,6 @@ bool pm_state_force(uint8_t cpu, const struct pm_state_info *info) bool pm_system_suspend(int32_t ticks) { - bool ret = true; uint8_t id = _current_cpu->id; SYS_PORT_TRACING_FUNC_ENTER(pm, system_suspend, ticks); @@ -216,9 +215,8 @@ bool pm_system_suspend(int32_t ticks) LOG_DBG("No PM operations done."); SYS_PORT_TRACING_FUNC_EXIT(pm, system_suspend, ticks, z_cpus_pm_state[id].state); - ret = false; atomic_clear_bit(z_cpus_pm_state_forced, id); - goto end; + return false; } if (ticks != K_TICKS_FOREVER) { @@ -241,9 +239,8 @@ bool pm_system_suspend(int32_t ticks) (void)atomic_add(&z_cpus_active, 1); SYS_PORT_TRACING_FUNC_EXIT(pm, system_suspend, ticks, z_cpus_pm_state[id].state); - ret = false; atomic_clear_bit(z_cpus_pm_state_forced, id); - goto end; + return false; } } #endif @@ -277,8 +274,7 @@ bool pm_system_suspend(int32_t ticks) SYS_PORT_TRACING_FUNC_EXIT(pm, system_suspend, ticks, z_cpus_pm_state[id].state); -end: - return ret; + return true; } void pm_notifier_register(struct pm_notifier *notifier)