From: David Howells <dhowells@redhat.com>
To: torvalds@osdl.org, akpm@linux-foundation.org
Cc: linux-kernel@vger.kernel.org, dhowells@redhat.com
Subject: [PATCH 2/2] FRV: Stop gcc from generating uninitialised variable warnings after BUG()
Date: Mon, 27 Apr 2009 11:55:23 +0100 [thread overview]
Message-ID: <20090427105522.26247.75354.stgit@warthog.procyon.org.uk> (raw)
In-Reply-To: <20090427105517.26247.30840.stgit@warthog.procyon.org.uk>
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>
---
arch/frv/include/asm/bug.h | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/arch/frv/include/asm/bug.h b/arch/frv/include/asm/bug.h
index 6b1b44d..2e05450 100644
--- a/arch/frv/include/asm/bug.h
+++ b/arch/frv/include/asm/bug.h
@@ -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() \
@@ -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>
prev parent reply other threads:[~2009-04-27 10:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-27 10:55 [PATCH 1/2] FRV: Wire up new syscalls David Howells
2009-04-27 10:55 ` David Howells [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090427105522.26247.75354.stgit@warthog.procyon.org.uk \
--to=dhowells@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®