Skip to content

Commit 3b7652a

Browse files
committed
zephyr: pm_runtime: use the correct type for CPU power state count
pm_state_cpu_get_all() returns uint8_t, so num_cpu_states must be uint8_t too. The explicit (int) cast on the loop init is only cosmetics, matching the Zephyr reference pm policy. Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
1 parent 0f9fa75 commit 3b7652a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

zephyr/lib/pm_runtime.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ DECLARE_TR_CTX(power_tr, SOF_UUID(power_uuid), LOG_LEVEL_INFO);
2121
#if defined(CONFIG_PM_POLICY_CUSTOM)
2222
const struct pm_state_info *pm_policy_next_state(uint8_t cpu, int32_t ticks)
2323
{
24-
unsigned int num_cpu_states;
24+
uint8_t num_cpu_states;
2525
const struct pm_state_info *cpu_states;
2626

2727
num_cpu_states = pm_state_cpu_get_all(cpu, &cpu_states);
2828

29-
for (int i = num_cpu_states - 1; i >= 0; i--) {
29+
for (int i = (int)num_cpu_states - 1; i >= 0; i--) {
3030
const struct pm_state_info *state = &cpu_states[i];
3131
uint32_t min_residency, exit_latency;
3232

0 commit comments

Comments
 (0)