[Concept,04/16] sandbox: Convert IRQ macros to static inline functions

Message ID 20251227204318.886983-5-sjg@u-boot.org
State New
Headers
Series fs: ext4l: Complete read-only filesystem support (Part I) |

Commit Message

Simon Glass Dec. 27, 2025, 8:42 p.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

Convert the local_irq_* macros to static inline functions to avoid
"unused variable 'flags'" warnings when building with the atomic
operations from asm-generic/atomic.h.

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---

 arch/sandbox/include/asm/system.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
  

Patch

diff --git a/arch/sandbox/include/asm/system.h b/arch/sandbox/include/asm/system.h
index 7933b6292e2..438e2f65dc8 100644
--- a/arch/sandbox/include/asm/system.h
+++ b/arch/sandbox/include/asm/system.h
@@ -7,10 +7,10 @@ 
 #define __ASM_SANDBOX_SYSTEM_H
 
 /* Define this as nops for sandbox architecture */
-#define local_irq_save(x)
-#define local_irq_enable()
-#define local_irq_disable()
-#define local_save_flags(x)
-#define local_irq_restore(x)
+#define local_irq_save(x)	((x) = 0)
+#define local_irq_enable()	do { } while (0)
+#define local_irq_disable()	do { } while (0)
+#define local_save_flags(x)	((x) = 0)
+#define local_irq_restore(x)	do { (void)(x); } while (0)
 
 #endif