[PATCH 11/11] ARM: BUG: Add WARN support via __WARN_FLAGS()

Sebastian Andrzej Siewior sebastian at breakpoint.cc
Fri Oct 9 15:21:18 PDT 2026


the recent rework makes it possible to add support for WARN_ON() and
friends by defining __WARN_FLAGS(). The __BUG_FLAGS() macro needs to
pass BUGFLAG_WARNING as option to distinguish it from BUG() entries.

Signed-off-by: Sebastian Andrzej Siewior <sebastian at breakpoint.cc>
---
 arch/arm/include/asm/bug.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/include/asm/bug.h b/arch/arm/include/asm/bug.h
index 963365b3158b9..f9c093bac432f 100644
--- a/arch/arm/include/asm/bug.h
+++ b/arch/arm/include/asm/bug.h
@@ -65,6 +65,9 @@ do {								\
 	unreachable();						\
 } while (0)
 
+#define __WARN_FLAGS(cond_str, flags)				\
+	asm volatile(__stringify(__BUG_FLAGS(__FILE__, __LINE__, BUGFLAG_WARNING|(flags))))
+
 #define HAVE_ARCH_BUG
 
 #include <asm-generic/bug.h>

-- 
2.55.0




More information about the linux-arm-kernel mailing list