diff --git a/arch/xtensa/src/esp32/esp32_gpio.c b/arch/xtensa/src/esp32/esp32_gpio.c index d12dcbc280..e6fa3a22db 100644 --- a/arch/xtensa/src/esp32/esp32_gpio.c +++ b/arch/xtensa/src/esp32/esp32_gpio.c @@ -412,7 +412,7 @@ bool esp32_gpioread(int pin) void esp32_gpioirqinitialize(int cpu) { #ifdef CONFIG_SMP - DEBUGASSERT(cpu >= 0 && cpu <= CONFIG_SMP_NCPUS); + DEBUGASSERT(cpu >= 0 && cpu < CONFIG_SMP_NCPUS); #else DEBUGASSERT(cpu == 0); #endif diff --git a/arch/xtensa/src/esp32/esp32_irq.c b/arch/xtensa/src/esp32/esp32_irq.c index 0388b24df6..76a686a435 100644 --- a/arch/xtensa/src/esp32/esp32_irq.c +++ b/arch/xtensa/src/esp32/esp32_irq.c @@ -519,7 +519,7 @@ void up_disable_irq(int irq) } DEBUGASSERT(cpuint >= 0 && cpuint <= ESP32_CPUINT_MAX); - DEBUGASSERT(cpu >= 0 && cpu <= CONFIG_SMP_NCPUS); + DEBUGASSERT(cpu >= 0 && cpu < CONFIG_SMP_NCPUS); if (irq < XTENSA_NIRQ_INTERNAL) { @@ -580,7 +580,7 @@ void up_enable_irq(int irq) int cpuint = IRQ_GETCPUINT(g_irqmap[irq]); DEBUGASSERT(cpuint >= 0 && cpuint <= ESP32_CPUINT_MAX); - DEBUGASSERT(cpu >= 0 && cpu <= CONFIG_SMP_NCPUS); + DEBUGASSERT(cpu >= 0 && cpu < CONFIG_SMP_NCPUS); if (irq < XTENSA_NIRQ_INTERNAL) {