Patchwork [2/9] powerpc: Fix asm EMIT_BUG_ENTRY with !CONFIG_BUG

login
register
mail settings
Submitter Benjamin Herrenschmidt
Date Dec. 8, 2008, 5:39 a.m.
Message ID <20081208054046.9B42EDDE19@ozlabs.org>
Download mbox | patch
Permalink /patch/12681/
State Accepted
Commit a58f053b93e15b68e7b5f442316329f68269c8d5
Headers show

Comments

Benjamin Herrenschmidt - Dec. 8, 2008, 5:39 a.m.
Instead of not defining it at all, this defines the macro as
being empty, thus avoiding ifdef's in call sites when CONFIG_BUG
is not set.

Also removes an extra whitespace in the existing definition

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---

 arch/powerpc/include/asm/bug.h |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

Patch

--- linux-work.orig/arch/powerpc/include/asm/bug.h	2008-12-08 14:37:16.000000000 +1100
+++ linux-work/arch/powerpc/include/asm/bug.h	2008-12-08 15:14:21.000000000 +1100
@@ -3,6 +3,7 @@ 
 #ifdef __KERNEL__
 
 #include <asm/asm-compat.h>
+
 /*
  * Define an illegal instr to trap on the bug.
  * We don't use 0 because that marks the end of a function
@@ -14,6 +15,7 @@ 
 #ifdef CONFIG_BUG
 
 #ifdef __ASSEMBLY__
+#include <asm/asm-offsets.h>
 #ifdef CONFIG_DEBUG_BUGVERBOSE
 .macro EMIT_BUG_ENTRY addr,file,line,flags
 	 .section __bug_table,"a"
@@ -26,7 +28,7 @@ 
 	 .previous
 .endm
 #else
- .macro EMIT_BUG_ENTRY addr,file,line,flags
+.macro EMIT_BUG_ENTRY addr,file,line,flags
 	 .section __bug_table,"a"
 5001:	 PPC_LONG \addr
 	 .short \flags
@@ -113,6 +115,13 @@ 
 #define HAVE_ARCH_BUG_ON
 #define HAVE_ARCH_WARN_ON
 #endif /* __ASSEMBLY __ */
+#else
+#ifdef __ASSEMBLY__
+.macro EMIT_BUG_ENTRY addr,file,line,flags
+.endm
+#else /* !__ASSEMBLY__ */
+#define _EMIT_BUG_ENTRY
+#endif
 #endif /* CONFIG_BUG */
 
 #include <asm-generic/bug.h>