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

FRV: Stop gcc from generating uninitialised variable warnings after BUG()

Stop gcc from generating uninitialised variable warnings after BUG().
The problem is that FRV's call into its gdbstub appears to return (if
the function is marked noreturn, then the compiler is under no
obligation to pass it a return address, and so GDB won't know where the
bug happened).

To get around this, we make the do...while wrapper in _debug_bug_trap()
an endless loop from which there's no escape.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

David Howells and committed by
Linus Torvalds
9a523d42 e37469f6

+3 -2
+3 -2
arch/frv/include/asm/bug.h
··· 30 30 do { \ 31 31 __debug_bug_trap(signr); \ 32 32 asm volatile("nop"); \ 33 - } while(0) 33 + } while(1) 34 34 35 35 #define HAVE_ARCH_BUG 36 36 #define BUG() \ ··· 46 46 #define HAVE_ARCH_KGDB_BAD_PAGE 47 47 #define kgdb_bad_page(page) do { kgdb_raise(SIGABRT); } while(0) 48 48 #endif 49 - #endif 49 + 50 + #endif /* CONFIG_BUG */ 50 51 51 52 #include <asm-generic/bug.h> 52 53