Skip to content

Commit

Permalink
pm: Remove CURRENT_CPU macro
Browse files Browse the repository at this point in the history
Just use _current_cpu that works with/without multicore.

Signed-off-by: Flavio Ceolin <[email protected]>
  • Loading branch information
Flavio Ceolin authored and carlescufi committed Jan 19, 2024
1 parent e11bbb8 commit b9d4b9d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions subsys/pm/pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(pm, CONFIG_PM_LOG_LEVEL);

#define CURRENT_CPU \
(COND_CODE_1(CONFIG_SMP, (arch_curr_cpu()->id), (_current_cpu->id)))

static ATOMIC_DEFINE(z_post_ops_required, CONFIG_MP_MAX_NUM_CPUS);
static sys_slist_t pm_notifiers = SYS_SLIST_STATIC_INIT(&pm_notifiers);

Expand Down Expand Up @@ -133,7 +130,7 @@ static inline void pm_state_notify(bool entering_state)

void pm_system_resume(void)
{
uint8_t id = CURRENT_CPU;
uint8_t id = _current_cpu->id;

/*
* This notification is called from the ISR of the event
Expand Down Expand Up @@ -171,7 +168,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;
uint8_t id = _current_cpu->id;
k_spinlock_key_t key;

SYS_PORT_TRACING_FUNC_ENTER(pm, system_suspend, ticks);
Expand Down

0 comments on commit b9d4b9d

Please sign in to comment.