From 3b7652a013e30dec3d3b1dcc535fa71f7ef5952f Mon Sep 17 00:00:00 2001 From: Adrian Bonislawski Date: Tue, 9 Jun 2026 12:56:04 +0200 Subject: [PATCH] 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 --- zephyr/lib/pm_runtime.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zephyr/lib/pm_runtime.c b/zephyr/lib/pm_runtime.c index fcaa03cb7275..21b3e3ae3df5 100644 --- a/zephyr/lib/pm_runtime.c +++ b/zephyr/lib/pm_runtime.c @@ -21,12 +21,12 @@ DECLARE_TR_CTX(power_tr, SOF_UUID(power_uuid), LOG_LEVEL_INFO); #if defined(CONFIG_PM_POLICY_CUSTOM) const struct pm_state_info *pm_policy_next_state(uint8_t cpu, int32_t ticks) { - unsigned int num_cpu_states; + uint8_t num_cpu_states; const struct pm_state_info *cpu_states; num_cpu_states = pm_state_cpu_get_all(cpu, &cpu_states); - for (int i = num_cpu_states - 1; i >= 0; i--) { + for (int i = (int)num_cpu_states - 1; i >= 0; i--) { const struct pm_state_info *state = &cpu_states[i]; uint32_t min_residency, exit_latency;