Skip to content

Commit

Permalink
FRV: Stop gcc from generating uninitialised variable warnings after B…
Browse files Browse the repository at this point in the history
…UG()

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 <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
dhowells authored and torvalds committed Apr 27, 2009
1 parent e37469f commit 9a523d4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions arch/frv/include/asm/bug.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ extern void __debug_bug_printk(const char *file, unsigned line);
do { \
__debug_bug_trap(signr); \
asm volatile("nop"); \
} while(0)
} while(1)

#define HAVE_ARCH_BUG
#define BUG() \
Expand All @@ -46,7 +46,8 @@ do { \
#define HAVE_ARCH_KGDB_BAD_PAGE
#define kgdb_bad_page(page) do { kgdb_raise(SIGABRT); } while(0)
#endif
#endif

#endif /* CONFIG_BUG */

#include <asm-generic/bug.h>

Expand Down

0 comments on commit 9a523d4

Please sign in to comment.