public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ralf Baechle <ralf@linux-mips.org>
To: David Daney <ddaney@caviumnetworks.com>
Cc: torvalds@linux-foundation.org, akpm@linux-foundation.org,
	linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org
Subject: [PATCH] MIPS: Make more use of unreachable()
Date: Tue, 15 Sep 2009 10:39:04 +0200	[thread overview]
Message-ID: <20090915083904.GA13796@linux-mips.org> (raw)
In-Reply-To: <1252965340-31735-3-git-send-email-ddaney@caviumnetworks.com>

Further uses of unreachable().

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

 arch/mips/fw/arc/memory.c     |    5 +++--
 arch/mips/kernel/signal.c     |    5 +++--
 arch/mips/kernel/signal32.c   |    5 +++--
 arch/mips/kernel/signal_n32.c |    3 ++-
 4 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/arch/mips/fw/arc/memory.c b/arch/mips/fw/arc/memory.c
index 8b8eea2..d248f64 100644
--- a/arch/mips/fw/arc/memory.c
+++ b/arch/mips/fw/arc/memory.c
@@ -11,6 +11,7 @@
  * because on some machines like SGI IP27 the ARC memory configuration data
  * completly bogus and alternate easier to use mechanisms are available.
  */
+#include <linux/compiler.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
@@ -80,7 +81,7 @@ static inline int memtype_classify_arcs(union linux_memtypes type)
 	default:
 		BUG();
 	}
-	while(1);				/* Nuke warning.  */
+	unreachable();				/* Nuke warning.  */
 }
 
 static inline int memtype_classify_arc(union linux_memtypes type)
@@ -100,7 +101,7 @@ static inline int memtype_classify_arc(union linux_memtypes type)
 	default:
 		BUG();
 	}
-	while(1);				/* Nuke warning.  */
+	unreachable();				/* Nuke warning.  */
 }
 
 static int __init prom_memtype_classify(union linux_memtypes type)
diff --git a/arch/mips/kernel/signal.c b/arch/mips/kernel/signal.c
index 6254041..eefd278 100644
--- a/arch/mips/kernel/signal.c
+++ b/arch/mips/kernel/signal.c
@@ -8,6 +8,7 @@
  * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
  */
 #include <linux/cache.h>
+#include <linux/compiler.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
 #include <linux/personality.h>
@@ -422,7 +423,7 @@ asmlinkage void sys_sigreturn(nabi_no_regargs struct pt_regs regs)
 		"j\tsyscall_exit"
 		:/* no outputs */
 		:"r" (&regs));
-	/* Unreached */
+	unreachable();
 
 badframe:
 	force_sig(SIGSEGV, current);
@@ -468,7 +469,7 @@ asmlinkage void sys_rt_sigreturn(nabi_no_regargs struct pt_regs regs)
 		"j\tsyscall_exit"
 		:/* no outputs */
 		:"r" (&regs));
-	/* Unreached */
+	unreachable();
 
 badframe:
 	force_sig(SIGSEGV, current);
diff --git a/arch/mips/kernel/signal32.c b/arch/mips/kernel/signal32.c
index 2e74075..d41e267 100644
--- a/arch/mips/kernel/signal32.c
+++ b/arch/mips/kernel/signal32.c
@@ -9,6 +9,7 @@
  */
 #include <linux/cache.h>
 #include <linux/compat.h>
+#include <linux/compiler.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
 #include <linux/smp.h>
@@ -526,7 +527,7 @@ asmlinkage void sys32_sigreturn(nabi_no_regargs struct pt_regs regs)
 		"j\tsyscall_exit"
 		:/* no outputs */
 		:"r" (&regs));
-	/* Unreached */
+	unreachable();
 
 badframe:
 	force_sig(SIGSEGV, current);
@@ -583,7 +584,7 @@ asmlinkage void sys32_rt_sigreturn(nabi_no_regargs struct pt_regs regs)
 		"j\tsyscall_exit"
 		:/* no outputs */
 		:"r" (&regs));
-	/* Unreached */
+	unreachable();
 
 badframe:
 	force_sig(SIGSEGV, current);
diff --git a/arch/mips/kernel/signal_n32.c b/arch/mips/kernel/signal_n32.c
index bb277e8..24ebaa5 100644
--- a/arch/mips/kernel/signal_n32.c
+++ b/arch/mips/kernel/signal_n32.c
@@ -16,6 +16,7 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
 #include <linux/cache.h>
+#include <linux/compiler.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
 #include <linux/smp.h>
@@ -167,7 +168,7 @@ asmlinkage void sysn32_rt_sigreturn(nabi_no_regargs struct pt_regs regs)
 		"j\tsyscall_exit"
 		:/* no outputs */
 		:"r" (&regs));
-	/* Unreached */
+	unreachable();
 
 badframe:
 	force_sig(SIGSEGV, current);

  reply	other threads:[~2009-09-15  8:39 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-14 21:50 [PATCH 00/11] Add support for GCC's __builtin_unreachable() and use it in BUG (v2) David Daney
2009-09-14 21:55 ` [PATCH 01/11] Add support for GCC-4.5's __builtin_unreachable() to compiler.h (v2) David Daney
2009-09-14 21:55 ` [PATCH 02/11] x86: Convert BUG() to use unreachable() David Daney
2009-09-14 21:55 ` [PATCH 03/11] MIPS: " David Daney
2009-09-15  8:39   ` Ralf Baechle [this message]
2009-09-14 21:55 ` [PATCH 04/11] s390: " David Daney
2009-09-14 21:55 ` [PATCH 05/11] mn10300: " David Daney
2009-09-14 21:55 ` [PATCH 06/11] parisc: " David Daney
2009-09-14 21:55 ` [PATCH 07/11] powerpc: " David Daney
2009-09-14 21:55 ` [PATCH 08/11] alpha: " David Daney
2009-09-14 21:55 ` [PATCH 09/11] avr32: " David Daney
2009-09-14 21:55 ` [PATCH 10/11] blackfin: " David Daney
2009-09-14 21:55 ` [PATCH 11/11] Use unreachable() in asm-generic/bug.h for !CONFIG_BUG case David Daney
2009-09-14 23:12   ` Brian Gerst
2009-09-14 23:28     ` David Daney
2009-09-14 23:39       ` Linus Torvalds
2009-09-15 15:35         ` David Daney
2009-09-14 23:54       ` Brian Gerst
2009-09-15 16:02         ` David Daney

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=20090915083904.GA13796@linux-mips.org \
    --to=ralf@linux-mips.org \
    --cc=akpm@linux-foundation.org \
    --cc=ddaney@caviumnetworks.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.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