diff options
author | Josh Triplett <josh@joshtriplett.org> | 2014-04-07 18:39:14 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-07 19:36:10 -0400 |
commit | b06dd879f5db33c1d7f5ab516ea671627f99c0c9 (patch) | |
tree | 85ee4edf96b8cdc094104afe8fd0ef204df452cc | |
parent | a4b5d580e07875f9be29f62a57c67fbbdbb40ba2 (diff) |
x86: always define BUG() and HAVE_ARCH_BUG, even with !CONFIG_BUG
This ensures that BUG() always has a definition that causes a trap (via
an undefined instruction), and that the compiler still recognizes the
code following BUG() as unreachable, avoiding warnings that would
otherwise appear (such as on non-void functions that don't return a
value after BUG()).
In addition to saving a few bytes over the generic infinite-loop
implementation, this implementation traps rather than looping, which
potentially allows for better error-recovery behavior (such as by
rebooting).
Signed-off-by: Josh Triplett <josh@joshtriplett.org>
Reported-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | arch/x86/include/asm/bug.h | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/arch/x86/include/asm/bug.h b/arch/x86/include/asm/bug.h index 2f03ff018d36..ba38ebbaced3 100644 --- a/arch/x86/include/asm/bug.h +++ b/arch/x86/include/asm/bug.h | |||
@@ -1,7 +1,6 @@ | |||
1 | #ifndef _ASM_X86_BUG_H | 1 | #ifndef _ASM_X86_BUG_H |
2 | #define _ASM_X86_BUG_H | 2 | #define _ASM_X86_BUG_H |
3 | 3 | ||
4 | #ifdef CONFIG_BUG | ||
5 | #define HAVE_ARCH_BUG | 4 | #define HAVE_ARCH_BUG |
6 | 5 | ||
7 | #ifdef CONFIG_DEBUG_BUGVERBOSE | 6 | #ifdef CONFIG_DEBUG_BUGVERBOSE |
@@ -33,8 +32,6 @@ do { \ | |||
33 | } while (0) | 32 | } while (0) |
34 | #endif | 33 | #endif |
35 | 34 | ||
36 | #endif /* !CONFIG_BUG */ | ||
37 | |||
38 | #include <asm-generic/bug.h> | 35 | #include <asm-generic/bug.h> |
39 | 36 | ||
40 | #endif /* _ASM_X86_BUG_H */ | 37 | #endif /* _ASM_X86_BUG_H */ |