[PATCH 04/11] ARM: BUG: Move file/ line encoding into a custom macro

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


Move the filename encoding and the line number into a custom macro named
_BUG_VERBOSE_LINE(). This makes it simpler to add this entries depending
on CONFIG_DEBUG_BUGVERBOSE.

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

diff --git a/arch/arm/include/asm/bug.h b/arch/arm/include/asm/bug.h
index 1bb215367eed2..18dc13a0509f6 100644
--- a/arch/arm/include/asm/bug.h
+++ b/arch/arm/include/asm/bug.h
@@ -27,18 +27,21 @@
 
 #ifdef CONFIG_DEBUG_BUGVERBOSE
 
-#define __BUG__LINE(__file, __line, __value)			\
-	1: ;							\
-	BUG_ENCODING();						\
-	.pushsection __bug_table,"aw";				\
-	.align 2;						\
-	.word 1b;						\
+#define _BUG_VERBOSE_LINE(__file, __line)			\
 	.pushsection .rodata.str, "aMS", %progbits, 1;		\
 	2: .asciz  __file;					\
 	.popsection;						\
 	3:							\
 	.word 2b;						\
 	.hword __line;						\
+
+#define __BUG__LINE(__file, __line, __value)			\
+	1: ;							\
+	BUG_ENCODING();						\
+	.pushsection __bug_table,"aw";				\
+	.align 2;						\
+	.word 1b;						\
+	_BUG_VERBOSE_LINE(__file, __line);			\
 	.hword 0;						\
 	.popsection;
 

-- 
2.55.0




More information about the linux-arm-kernel mailing list