gustavonihei commented on code in PR #6003:
URL: https://github.com/apache/incubator-nuttx/pull/6003#discussion_r844997661


##########
arch/risc-v/src/esp32c3/esp32c3_irq.c:
##########
@@ -371,38 +371,32 @@ IRAM_ATTR uintptr_t *esp32c3_dispatch_irq(uintptr_t 
mcause, uintptr_t *regs)
 
   irqinfo("INFO: mcause=%08" PRIXPTR "\n", mcause);
 
-  if ((RISCV_IRQ_BIT & mcause) != 0)
-    {
-      uint8_t cpuint = mcause & RISCV_IRQ_MASK;
-
-      DEBUGASSERT(cpuint <= ESP32C3_CPUINT_MAX);
+  DEBUGASSERT(cpuint <= ESP32C3_CPUINT_MAX);
 
-      irqinfo("INFO: cpuint=%" PRIu8 "\n", cpuint);
+  irqinfo("INFO: cpuint=%" PRIu8 "\n", cpuint);
 
+  if ((RISCV_IRQ_BIT & mcause) != 0)

Review Comment:
   @no1wudi `(RISCV_IRQ_BIT & mcause) != 0` test repeats several times, how 
about creating a local boolean variable?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to