Skip to content

Commit f13d52c

Browse files
arndbctmarinas
authored andcommitted
arm64: define BUG() instruction without CONFIG_BUG
This mirrors commit e9c38ce ("ARM: 8455/1: define __BUG as asm(BUG_INSTR) without CONFIG_BUG") to make the behavior of arm64 consistent with arm and x86, and avoids lots of warnings in randconfig builds, such as: kernel/seccomp.c: In function '__seccomp_filter': kernel/seccomp.c:666:1: error: no return statement in function returning non-void [-Werror=return-type] Acked-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
1 parent c651aae commit f13d52c

File tree

1 file changed

+19
-14
lines changed
  • arch/arm64/include/asm

1 file changed

+19
-14
lines changed

arch/arm64/include/asm/bug.h

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@
2020

2121
#include <asm/brk-imm.h>
2222

23-
#ifdef CONFIG_GENERIC_BUG
24-
#define HAVE_ARCH_BUG
25-
2623
#ifdef CONFIG_DEBUG_BUGVERBOSE
2724
#define _BUGVERBOSE_LOCATION(file, line) __BUGVERBOSE_LOCATION(file, line)
2825
#define __BUGVERBOSE_LOCATION(file, line) \
@@ -36,28 +33,36 @@
3633
#define _BUGVERBOSE_LOCATION(file, line)
3734
#endif
3835

39-
#define _BUG_FLAGS(flags) __BUG_FLAGS(flags)
36+
#ifdef CONFIG_GENERIC_BUG
4037

41-
#define __BUG_FLAGS(flags) asm volatile ( \
38+
#define __BUG_ENTRY(flags) \
4239
".pushsection __bug_table,\"a\"\n\t" \
4340
".align 2\n\t" \
4441
"0: .long 1f - 0b\n\t" \
4542
_BUGVERBOSE_LOCATION(__FILE__, __LINE__) \
4643
".short " #flags "\n\t" \
4744
".popsection\n" \
48-
\
49-
"1: brk %[imm]" \
50-
:: [imm] "i" (BUG_BRK_IMM) \
51-
)
45+
"1: "
46+
#else
47+
#define __BUG_ENTRY(flags) ""
48+
#endif
49+
50+
#define __BUG_FLAGS(flags) \
51+
asm volatile ( \
52+
__BUG_ENTRY(flags) \
53+
"brk %[imm]" :: [imm] "i" (BUG_BRK_IMM) \
54+
);
5255

53-
#define BUG() do { \
54-
_BUG_FLAGS(0); \
55-
unreachable(); \
56+
57+
#define BUG() do { \
58+
__BUG_FLAGS(0); \
59+
unreachable(); \
5660
} while (0)
5761

58-
#define __WARN_TAINT(taint) _BUG_FLAGS(BUGFLAG_TAINT(taint))
62+
#define __WARN_TAINT(taint) \
63+
__BUG_FLAGS(BUGFLAG_TAINT(taint))
5964

60-
#endif /* ! CONFIG_GENERIC_BUG */
65+
#define HAVE_ARCH_BUG
6166

6267
#include <asm-generic/bug.h>
6368

0 commit comments

Comments
 (0)