x86/debug: Define BUG() again for !CONFIG_BUG
authorArnd Bergmann <arnd@arndb.de>
Wed, 29 Mar 2017 21:16:31 +0000 (23:16 +0200)
committerIngo Molnar <mingo@kernel.org>
Thu, 30 Mar 2017 07:12:10 +0000 (09:12 +0200)
commit70579a86e3c8eb2ce57999e594a73b4dfe095959
treeed0bb8685c56a9c5e53b24cc6a44abdf1291577d
parent9a93848fe787a53aec404e4e00d8f7f9bbdaebb4
x86/debug: Define BUG() again for !CONFIG_BUG

The latest change to the BUG() macro inadvertently reverted the earlier
commit:

  b06dd879f5db ("x86: always define BUG() and HAVE_ARCH_BUG, even with !CONFIG_BUG")

... that sanitized the behavior with CONFIG_BUG=n.

I noticed this as some warnings have appeared again that were previously
fixed as a side effect of that patch:

  kernel/seccomp.c: In function '__seccomp_filter':
  kernel/seccomp.c:670:1: error: no return statement in function returning non-void [-Werror=return-type]
  ...

This combines the two patches and uses the ud2 macro to define BUG()
in case of CONFIG_BUG=n.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Josh Triplett <josh@joshtriplett.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Fixes: 9a93848fe787 ("x86/debug: Implement __WARN() using UD0")
Link: http://lkml.kernel.org/r/20170329211646.2707365-1-arnd@arndb.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/include/asm/bug.h