mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rabin Vincent <rabin@rab.in>
To: jesper.nilsson@axis.com
Cc: linux-kernel@vger.kernel.org, linux-cris-kernel@axis.com,
	Rabin Vincent <rabin@rab.in>
Subject: [PATCH 1/2] CRISv32: add unreachable() to BUG()
Date: Thu, 14 May 2015 14:36:55 +0200	[thread overview]
Message-ID: <1431607016-6301-1-git-send-email-rabin@rab.in> (raw)

Add an unreachable() in the BUG() implementations, to get rid of
several warnings similar to the one below:

 kernel/sched/core.c: In function 'pick_next_task':
 kernel/sched/core.c:2690:1: warning: control reaches end of non-void function [-Wreturn-type]

Signed-off-by: Rabin Vincent <rabin@rab.in>
---
 arch/cris/include/arch-v32/arch/bug.h | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/arch/cris/include/arch-v32/arch/bug.h b/arch/cris/include/arch-v32/arch/bug.h
index 0f211e1..fb59faa 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,9 +22,15 @@
 			      ".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")
+#define BUG() 					\
+do {						\
+	__asm__ __volatile__ ("break 14\n\t");	\
+	unreachable();				\
+} while (0)
 #endif
 
 #define HAVE_ARCH_BUG
-- 
2.1.4


             reply	other threads:[~2015-05-14 12:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-14 12:36 Rabin Vincent [this message]
2015-05-14 12:36 ` [PATCH 2/2] CRISv32: allow CONFIG_DEBUG_BUGVERBOSE Rabin Vincent
2015-05-17 19:15   ` Jesper Nilsson
2015-05-17 19:09 ` [PATCH 1/2] CRISv32: add unreachable() to BUG() Jesper Nilsson

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=1431607016-6301-1-git-send-email-rabin@rab.in \
    --to=rabin@rab.in \
    --cc=jesper.nilsson@axis.com \
    --cc=linux-cris-kernel@axis.com \
    --cc=linux-kernel@vger.kernel.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®