Skip to content

Commit a5fc5eb

Browse files
David Daneytorvalds
authored andcommitted
x86: Convert BUG() to use unreachable()
Use the new unreachable() macro instead of for(;;);. When allyesconfig is built with a GCC-4.5 snapshot on i686 the size of the text segment is reduced by 3987 bytes (from 6827019 to 6823032). Signed-off-by: David Daney <ddaney@caviumnetworks.com> Acked-by: "H. Peter Anvin" <hpa@zytor.com> CC: Thomas Gleixner <tglx@linutronix.de> CC: Ingo Molnar <mingo@redhat.com> CC: x86@kernel.org Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 38938c8 commit a5fc5eb

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • arch/x86/include/asm

‎arch/x86/include/asm/bug.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ do { \
2222
".popsection" \
2323
: : "i" (__FILE__), "i" (__LINE__), \
2424
"i" (sizeof(struct bug_entry))); \
25-
for (;;) ; \
25+
unreachable(); \
2626
} while (0)
2727

2828
#else
2929
#define BUG() \
3030
do { \
3131
asm volatile("ud2"); \
32-
for (;;) ; \
32+
unreachable(); \
3333
} while (0)
3434
#endif
3535

0 commit comments

Comments
 (0)