Commit 3a6a62f9 authored by Olof Johansson's avatar Olof Johansson Committed by Ingo Molnar

debug: introduce __WARN()

Introduce __WARN() in the generic case, so the generic WARN_ON()
can use arch-specific code for when the condition is true.
Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
Cc: <linux-arch@vger.kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent f315decb
...@@ -31,14 +31,19 @@ struct bug_entry { ...@@ -31,14 +31,19 @@ struct bug_entry {
#define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while(0) #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while(0)
#endif #endif
#ifndef HAVE_ARCH_WARN_ON #ifndef __WARN
#define WARN_ON(condition) ({ \ #define __WARN() do { \
int __ret_warn_on = !!(condition); \
if (unlikely(__ret_warn_on)) { \
printk("WARNING: at %s:%d %s()\n", __FILE__, \ printk("WARNING: at %s:%d %s()\n", __FILE__, \
__LINE__, __FUNCTION__); \ __LINE__, __FUNCTION__); \
dump_stack(); \ dump_stack(); \
} \ } while (0)
#endif
#ifndef WARN_ON
#define WARN_ON(condition) ({ \
int __ret_warn_on = !!(condition); \
if (unlikely(__ret_warn_on)) \
__WARN(); \
unlikely(__ret_warn_on); \ unlikely(__ret_warn_on); \
}) })
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment