From: Nick Krause <xerofoiify@gmail.com>
To: Mikael Starvik <starvik@axis.com>,
Jesper Nilsson <jesper.nilsson@axis.com>,
"GitAuthor: Nick Krause" <xerofoiify@gmail.com>,
linux-cris-kernel@axis.com (open list:CRIS PORT),
linux-kernel@vger.kernel.org (open list)
Subject: [PATCH] cris: bug: add unreachable() to silence warnings
Date: Thu, 7 Aug 2014 06:01:14 +0200 [thread overview]
Message-ID: <1407384076-20060-1-git-send-email-xerofoiify@gmail.com> (raw)
Cris BUG() have warnings like
drivers/memstick/core/ms_block.c:677:1: warning: control reaches end of non-void function
drivers/memstick/core/ms_block.c:720:1: warning: control reaches end of non-void function
drivers/memstick/core/ms_block.c:654:1: warning: control reaches end of non-void function
drivers/memstick/core/ms_block.c:465:1: warning: control reaches end of non-void function
drivers/memstick/core/mspro_block.c:663:1: warning: control reaches end of non-void function
Other BUG() implementations
have added unreachable() at end becuase of which I guess
it does not showthese errors. We can silence them using unreachable().
Signed-off-by: Nick Krause <xerofoify@gmail.com>
---
arch/cris/include/arch-v10/arch/bug.h | 5 ++++-
arch/cris/include/arch-v32/arch/bug.h | 5 ++++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/arch/cris/include/arch-v10/arch/bug.h b/arch/cris/include/arch-v10/arch/bug.h
index 3485d6b..40e65ad 100644
--- a/arch/cris/include/arch-v10/arch/bug.h
+++ b/arch/cris/include/arch-v10/arch/bug.h
@@ -43,12 +43,15 @@ struct bug_frame {
* not be used like this with newer versions of gcc.
*/
#define BUG() \
+do { \
__asm__ __volatile__ ("clear.d [" __stringify(BUG_MAGIC) "]\n\t"\
"movu.w " __stringify(__LINE__) ",$r0\n\t"\
"jump 0f\n\t" \
".section .rodata\n" \
"0:\t.string \"" __FILE__ "\"\n\t" \
- ".previous")
+ ".previous"); \
+ unreachable(); \
+} while (0)
#endif
#else
diff --git a/arch/cris/include/arch-v32/arch/bug.h b/arch/cris/include/arch-v32/arch/bug.h
index 0f211e1..55350a3 100644
--- a/arch/cris/include/arch-v32/arch/bug.h
+++ b/arch/cris/include/arch-v32/arch/bug.h
@@ -10,6 +10,7 @@
* All other stuff is done out-of-band with exception handlers.
*/
#define BUG() \
+do { \
__asm__ __volatile__ ("0: break 14\n\t" \
".section .fixup,\"ax\"\n" \
"1:\n\t" \
@@ -21,7 +22,9 @@
".section __ex_table,\"a\"\n\t" \
".dword 0b, 1b\n\t" \
".previous\n\t" \
- : : "ri" (__FILE__), "i" (__LINE__))
+ : : "ri" (__FILE__), "i" (__LINE__)); \
+ unreachable();
+} while (0)
#else
#define BUG() __asm__ __volatile__ ("break 14\n\t")
#endif
--
2.0.1
next reply other threads:[~2014-08-07 4:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-07 4:01 Nick Krause [this message]
[not found] ` <53E32982.6010409@redhat.com>
2014-08-11 5:36 ` Mikael Starvik
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=1407384076-20060-1-git-send-email-xerofoiify@gmail.com \
--to=xerofoiify@gmail.com \
--cc=jesper.nilsson@axis.com \
--cc=linux-cris-kernel@axis.com \
--cc=linux-kernel@vger.kernel.org \
--cc=starvik@axis.com \
/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
Powered by JetHome