Skip to content

Commit b0a848f

Browse files
author
Peter Zijlstra
committed
x86/bugs: Make i386 use GENERIC_BUG_RELATIVE_POINTERS
Linus figured less #ifdef is more better and making x86-32 use GENERIC_BUG_RELATIVE_POINTERS removes one layer of macro magic from the bug.h bits. Suggested-by: Linus Torvalds <torvalds@linuxfoundation.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
1 parent d62e4f2 commit b0a848f

2 files changed

Lines changed: 5 additions & 11 deletions

File tree

arch/x86/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ config GENERIC_CSUM
380380
config GENERIC_BUG
381381
def_bool y
382382
depends on BUG
383-
select GENERIC_BUG_RELATIVE_POINTERS if X86_64
383+
select GENERIC_BUG_RELATIVE_POINTERS
384384

385385
config GENERIC_BUG_RELATIVE_POINTERS
386386
bool

arch/x86/include/asm/bug.h

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,24 +42,18 @@ extern void __WARN_trap(struct bug_entry *bug, ...);
4242

4343
#ifdef CONFIG_GENERIC_BUG
4444

45-
#ifdef CONFIG_X86_32
46-
#define __BUG_REL(val) ".long " val
47-
#else
48-
#define __BUG_REL(val) ".long " val " - ."
49-
#endif
50-
5145
#ifdef CONFIG_DEBUG_BUGVERBOSE
5246
#define __BUG_ENTRY_VERBOSE(file, line) \
53-
"\t" __BUG_REL(file) "\t# bug_entry::file\n" \
54-
"\t.word " line "\t# bug_entry::line\n"
47+
"\t.long " file " - .\t# bug_entry::file\n" \
48+
"\t.word " line "\t# bug_entry::line\n"
5549
#else
5650
#define __BUG_ENTRY_VERBOSE(file, line)
5751
#endif
5852

5953
#if defined(CONFIG_X86_64) || defined(CONFIG_DEBUG_BUGVERBOSE_DETAILED)
6054
#define HAVE_ARCH_BUG_FORMAT
6155
#define __BUG_ENTRY_FORMAT(format) \
62-
"\t" __BUG_REL(format) "\t# bug_entry::format\n"
56+
"\t.long " format " - .\t# bug_entry::format\n"
6357
#else
6458
#define __BUG_ENTRY_FORMAT(format)
6559
#endif
@@ -69,7 +63,7 @@ extern void __WARN_trap(struct bug_entry *bug, ...);
6963
#endif
7064

7165
#define __BUG_ENTRY(format, file, line, flags) \
72-
__BUG_REL("1b") "\t# bug_entry::bug_addr\n" \
66+
"\t.long 1b - ." "\t# bug_entry::bug_addr\n" \
7367
__BUG_ENTRY_FORMAT(format) \
7468
__BUG_ENTRY_VERBOSE(file, line) \
7569
"\t.word " flags "\t# bug_entry::flags\n"

0 commit comments

Comments
 (0)