[PATCH 07/11] ARM: BUG: Pass a flags argument to __BUG__LINE()

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


Since the hard coding of the BUG-opcode, the value argument remained
unused. Repurpose that argument as flags from struct bug_entry. For now
this is set to 0.

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

diff --git a/arch/arm/include/asm/bug.h b/arch/arm/include/asm/bug.h
index c47b693aed8ae..b9e58be656360 100644
--- a/arch/arm/include/asm/bug.h
+++ b/arch/arm/include/asm/bug.h
@@ -20,8 +20,8 @@
 #endif
 
 
-#define BUG() _BUG(__FILE__, __LINE__, BUG_INSTR_VALUE)
-#define _BUG(file, line, value) __BUG(file, line, value)
+#define BUG() _BUG(__FILE__, __LINE__)
+#define _BUG(file, line) __BUG(file, line)
 
 #ifdef CONFIG_DEBUG_BUGVERBOSE
 #define _BUG_VERBOSE_LINE(__file, __line)			\
@@ -37,22 +37,22 @@
 #endif
 
 #ifdef CONFIG_GENERIC_BUG
-#define __BUG_ENTRY_GENERIC(__file, __line, __value)		\
+#define __BUG_ENTRY_GENERIC(__file, __line, __flags)		\
 	.pushsection __bug_table,"aw";				\
 	.align 2;						\
 	.word 1b;						\
 	_BUG_VERBOSE_LINE(__file, __line);			\
-	.hword 0;						\
+	.hword __flags;						\
 	.popsection;
 
 #else
-#define __BUG_ENTRY_GENERIC(__file, __line, __value)
+#define __BUG_ENTRY_GENERIC(__file, __line, __flags)
 #endif
 
-#define __BUG__LINE(__file, __line, __value)			\
+#define __BUG__LINE(__file, __line, __flags)			\
 	1: ;							\
 	BUG_ENCODING();						\
-	__BUG_ENTRY_GENERIC(__file, __line, __value);
+	__BUG_ENTRY_GENERIC(__file, __line, __flags);
 
 /*
  * The extra indirection is to ensure that the __FILE__ string comes through
@@ -60,9 +60,9 @@
  * preferable to this unpleasantness. We use mergeable string sections to
  * avoid multiple copies of the string appearing in the kernel image.
  */
-#define __BUG(__file, __line, __value)				\
+#define __BUG(__file, __line)					\
 do {								\
-	asm volatile(__stringify(__BUG__LINE(__file, __line, __value))); \
+	asm volatile(__stringify(__BUG__LINE(__file, __line, 0))); \
 	unreachable();						\
 } while (0)
 

-- 
2.55.0




More information about the linux-arm-kernel mailing list