Skip to content

Commit

Permalink
ARM: 8455/1: define __BUG as asm(BUG_INSTR) without CONFIG_BUG
Browse files Browse the repository at this point in the history
Following (a long time after) a4b5d58 ("bug: Make BUG() always stop
the machine"), this adapts the ARM architecture to no longer rely
on the sub-optimal BUG() definition that has a silent endless loop
but instead use the same trapping instruction that we have for
the full BUG() support.

This avoids hundreds of warnings like

arch/arm/include/asm/xen/page.h: In function 'arbitrary_virt_to_machine':
arch/arm/include/asm/xen/page.h:85:1: warning: no return statement in function returning non-void [-Wreturn-type]

and also makes the code size slightly smaller. The behavior changes
from silently stopping the kernel to an oops, and follows what x86
does these days.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Arnd Bergmann authored and Russell King committed Dec 3, 2015
1 parent a4124e7 commit e9c38ce
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions arch/arm/include/asm/bug.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
#include <linux/types.h>
#include <asm/opcodes.h>

#ifdef CONFIG_BUG

/*
* Use a suitable undefined instruction to use for ARM/Thumb2 bug handling.
* We need to be careful not to conflict with those used by other modules and
Expand Down Expand Up @@ -47,7 +45,7 @@ do { \
unreachable(); \
} while (0)

#else /* not CONFIG_DEBUG_BUGVERBOSE */
#else

#define __BUG(__file, __line, __value) \
do { \
Expand All @@ -57,7 +55,6 @@ do { \
#endif /* CONFIG_DEBUG_BUGVERBOSE */

#define HAVE_ARCH_BUG
#endif /* CONFIG_BUG */

#include <asm-generic/bug.h>

Expand Down

0 comments on commit e9c38ce

Please sign in to comment.