public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bug: Fix CONFIG_BUG=n BUG_ON()
@ 2014-06-19 13:28 Bart Van Assche
  2014-06-19 15:22 ` Josh Triplett
  2014-06-19 17:00 ` Arnd Bergmann
  0 siblings, 2 replies; 6+ messages in thread
From: Bart Van Assche @ 2014-06-19 13:28 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: Josh Triplett, Andrew Morton, linux-kernel

Patch "bug: Make BUG() always stop the machine" changed the
behavior of BUG() with CONFIG_BUG=n from a no-op into an infinite
loop. Modify the definition of BUG_ON() accordingly such that the
behavior of BUG_ON(1) is identical to that of BUG().

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Josh Triplett <josh@joshtriplett.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 include/asm-generic/bug.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h
index 630dd23..f3241cd 100644
--- a/include/asm-generic/bug.h
+++ b/include/asm-generic/bug.h
@@ -142,7 +142,7 @@ extern void warn_slowpath_null(const char *file, const int line);
 #endif
 
 #ifndef HAVE_ARCH_BUG_ON
-#define BUG_ON(condition) do { if (condition) ; } while (0)
+#define BUG_ON(condition) do { } while (unlikely(condition))
 #endif
 
 #ifndef HAVE_ARCH_WARN_ON
-- 
1.8.4.5


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-06-19 18:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-19 13:28 [PATCH] bug: Fix CONFIG_BUG=n BUG_ON() Bart Van Assche
2014-06-19 15:22 ` Josh Triplett
2014-06-19 17:00 ` Arnd Bergmann
2014-06-19 17:21   ` josh
2014-06-19 17:51     ` Bart Van Assche
2014-06-19 18:12       ` josh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox