From 238a96e7de402c9691c91346f931e26859dc027c Mon Sep 17 00:00:00 2001 From: Abdelatif Guettouche Date: Tue, 3 Aug 2021 14:13:15 +0200 Subject: [PATCH] arch/esp32_cpuint.c: Simplify up_disable/enable_irq. Signed-off-by: Abdelatif Guettouche --- arch/xtensa/src/esp32/esp32_cpuint.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/arch/xtensa/src/esp32/esp32_cpuint.c b/arch/xtensa/src/esp32/esp32_cpuint.c index b7c941c726..515ac471e4 100644 --- a/arch/xtensa/src/esp32/esp32_cpuint.c +++ b/arch/xtensa/src/esp32/esp32_cpuint.c @@ -399,18 +399,11 @@ int esp32_cpuint_initialize(void) void up_disable_irq(int cpuint) { -#ifdef CONFIG_SMP - int cpu; -#endif + int cpu = up_cpu_index(); DEBUGASSERT(cpuint >= 0 && cpuint <= ESP32_CPUINT_MAX); -#ifdef CONFIG_SMP - cpu = up_cpu_index(); xtensa_disable_cpuint(&g_intenable[cpu], (1ul << cpuint)); -#else - xtensa_disable_cpuint(&g_intenable[0], (1ul << cpuint)); -#endif } /**************************************************************************** @@ -423,18 +416,11 @@ void up_disable_irq(int cpuint) void up_enable_irq(int cpuint) { -#ifdef CONFIG_SMP - int cpu; -#endif + int cpu = up_cpu_index(); DEBUGASSERT(cpuint >= 0 && cpuint <= ESP32_CPUINT_MAX); -#ifdef CONFIG_SMP - cpu = up_cpu_index(); xtensa_enable_cpuint(&g_intenable[cpu], (1ul << cpuint)); -#else - xtensa_enable_cpuint(&g_intenable[0], (1ul << cpuint)); -#endif } /****************************************************************************