pm: Avoid unnecessary check in SMP

_current_cpu is a macro that expands to an assert that checks if the
current context can be migrated to a another cpu. Since this
pm_system_suspend() is called from the idle thread (each cpu has its
own) and  with locked this check is redundant. Just use
arch_curr_cpu() to avoid it.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
Flavio Ceolin 2022-06-14 00:15:49 -07:00 committed by Anas Nashif
commit f232db4630

View file

@ -201,7 +201,7 @@ bool pm_state_force(uint8_t cpu, const struct pm_state_info *info)
bool pm_system_suspend(int32_t ticks)
{
uint8_t id = _current_cpu->id;
uint8_t id = CURRENT_CPU;
k_spinlock_key_t key;
SYS_PORT_TRACING_FUNC_ENTER(pm, system_suspend, ticks);