From a5cd799523a1ddf288cf605f095a9ada29fc98d4 Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Fri, 10 Apr 2020 07:31:20 -0500 Subject: [PATCH] arch: riscv: irq: fix build warning In arch_irq_connect_dynamic the 'level' variable is only used on platforms that define CONFIG_RISCV_HAS_PLIC. For the other platforms we'll get a warning about an unused variable. Remove the need for 'level' and just call irq_get_level() where its needed to address the issue. Signed-off-by: Kumar Gala --- arch/riscv/core/irq_manage.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/arch/riscv/core/irq_manage.c b/arch/riscv/core/irq_manage.c index c1152dc275e..b852433e9ed 100644 --- a/arch/riscv/core/irq_manage.c +++ b/arch/riscv/core/irq_manage.c @@ -34,16 +34,12 @@ int arch_irq_connect_dynamic(unsigned int irq, unsigned int priority, void (*routine)(void *parameter), void *parameter, u32_t flags) { - unsigned int level; - ARG_UNUSED(flags); z_isr_install(irq, routine, parameter); #if defined(CONFIG_RISCV_HAS_PLIC) - level = irq_get_level(irq); - - if (level == 2) { + if (irq_get_level(irq) == 2) { irq = irq_from_level_2(irq); riscv_plic_set_priority(irq, priority);