]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
objtool: Enclose contents of unreachable() macro in a block
authorJosh Poimboeuf <jpoimboe@redhat.com>
Tue, 28 Feb 2017 04:21:16 +0000 (22:21 -0600)
committerIngo Molnar <mingo@kernel.org>
Tue, 28 Feb 2017 06:47:26 +0000 (07:47 +0100)
Guenter Roeck reported a boot failure in mips64.  It was bisected to the
following commit:

  d1091c7fa3d5 ("objtool: Improve detection of BUG() and other dead ends")

The unreachable() macro was formerly only composed of a single
statement.  The above commit added a second statement, but neglected to
enclose the statements in a block.

Suggested-by: Guenter Roeck <linux@roeck-us.net>
Reported-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Fixes: d1091c7fa3d5 ("objtool: Improve detection of BUG() and other dead ends")
Link: http://lkml.kernel.org/r/20170228042116.glmwmwiohcix7o4a@treble
Signed-off-by: Ingo Molnar <mingo@kernel.org>
include/linux/compiler-gcc.h

index de471346b365f82809f109b3c90288213771f759..f457b520ead6e81d4cde702bf0eb13d74eb7907d 100644 (file)
  * this in the preprocessor, but we can live with this because they're
  * unreleased.  Really, we need to have autoconf for the kernel.
  */
-#define unreachable() annotate_unreachable(); __builtin_unreachable()
+#define unreachable() \
+       do { annotate_unreachable(); __builtin_unreachable(); } while (0)
 
 /* Mark a function definition as prohibited from being cloned. */
 #define __noclone      __attribute__((__noclone__, __optimize__("no-tracer")))