Skip to content

Commit 95c13fc

Browse files
committed
drivers: intc: irqstr: Fix uninitialized variable error
Move initialization of 'enabled' variable together with declaration. This fixes the following compiler error: error: 'enabled' may be used uninitialized [-Werror=maybe-uninitialized] This is not really an error but the compiler is tricked by the K_SPINLOCK() macro. Fixes: zephyrproject-rtos#88996 Signed-off-by: Daniel Baluta <[email protected]>
1 parent eca5790 commit 95c13fc

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/interrupt_controller/intc_nxp_irqsteer.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ int z_soc_irq_is_enabled(unsigned int irq)
549549
uint32_t parent_irq;
550550
int i;
551551
const struct irqsteer_config *cfg;
552-
bool enabled;
552+
bool enabled = false;
553553

554554
if (irq_get_level(irq) == 1) {
555555
K_SPINLOCK(&irqstr_lock) {
@@ -559,7 +559,6 @@ int z_soc_irq_is_enabled(unsigned int irq)
559559
}
560560

561561
parent_irq = irq_parent_level_2(irq);
562-
enabled = false;
563562

564563
/* find dispatcher responsible for this interrupt */
565564
for (i = 0; i < ARRAY_SIZE(dispatchers); i++) {

0 commit comments

Comments
 (0)