From a800fcb47ee36c43cab5b2036e0845d30644a1fd Mon Sep 17 00:00:00 2001 From: Konstantin Kondrashov Date: Wed, 22 May 2024 11:20:08 +0300 Subject: [PATCH] fix(esp_timer): Fix Coverity issue - logically dead code in esp_timer_impl_early_init --- components/esp_timer/src/esp_timer_impl_systimer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/esp_timer/src/esp_timer_impl_systimer.c b/components/esp_timer/src/esp_timer_impl_systimer.c index 549316a6da..97d3c56ab4 100644 --- a/components/esp_timer/src/esp_timer_impl_systimer.c +++ b/components/esp_timer/src/esp_timer_impl_systimer.c @@ -181,7 +181,8 @@ esp_err_t esp_timer_impl_early_init(void) systimer_hal_connect_alarm_counter(&systimer_hal, SYSTIMER_ALARM_ESPTIMER, SYSTIMER_COUNTER_ESPTIMER); for (unsigned cpuid = 0; cpuid < SOC_CPU_CORES_NUM; ++cpuid) { - systimer_hal_counter_can_stall_by_cpu(&systimer_hal, SYSTIMER_COUNTER_ESPTIMER, cpuid, (cpuid < portNUM_PROCESSORS) ? true : false); + bool can_stall = (cpuid < portNUM_PROCESSORS); + systimer_hal_counter_can_stall_by_cpu(&systimer_hal, SYSTIMER_COUNTER_ESPTIMER, cpuid, can_stall); } return ESP_OK;