Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: 8455/1: define __BUG as asm(BUG_INSTR) without CONFIG_BUG

Following (a long time after) a4b5d580e078 ("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>

authored by

Arnd Bergmann and committed by
Russell King
e9c38ceb a4124e72

+1 -4
+1 -4
arch/arm/include/asm/bug.h
··· 5 5 #include <linux/types.h> 6 6 #include <asm/opcodes.h> 7 7 8 - #ifdef CONFIG_BUG 9 - 10 8 /* 11 9 * Use a suitable undefined instruction to use for ARM/Thumb2 bug handling. 12 10 * We need to be careful not to conflict with those used by other modules and ··· 45 47 unreachable(); \ 46 48 } while (0) 47 49 48 - #else /* not CONFIG_DEBUG_BUGVERBOSE */ 50 + #else 49 51 50 52 #define __BUG(__file, __line, __value) \ 51 53 do { \ ··· 55 57 #endif /* CONFIG_DEBUG_BUGVERBOSE */ 56 58 57 59 #define HAVE_ARCH_BUG 58 - #endif /* CONFIG_BUG */ 59 60 60 61 #include <asm-generic/bug.h> 61 62