diff options
author | Olof Johansson <olof@lixom.net> | 2008-01-30 07:32:50 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:32:50 -0500 |
commit | 3a6a62f96f168d192fb0cc9c0b5ee2584740b32d (patch) | |
tree | 8817fb64361a30604a8fcb8663326261a755ac59 /include/asm-generic/bug.h | |
parent | f315decbd05fefbca09bd492ae54eaa334ba826b (diff) |
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: Olof Johansson <olof@lixom.net>
Cc: <linux-arch@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/asm-generic/bug.h')
-rw-r--r-- | include/asm-generic/bug.h | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h index d56fedbb457a..1a0e1a7684bd 100644 --- a/include/asm-generic/bug.h +++ b/include/asm-generic/bug.h | |||
@@ -31,14 +31,19 @@ struct bug_entry { | |||
31 | #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while(0) | 31 | #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while(0) |
32 | #endif | 32 | #endif |
33 | 33 | ||
34 | #ifndef HAVE_ARCH_WARN_ON | 34 | #ifndef __WARN |
35 | #define __WARN() do { \ | ||
36 | printk("WARNING: at %s:%d %s()\n", __FILE__, \ | ||
37 | __LINE__, __FUNCTION__); \ | ||
38 | dump_stack(); \ | ||
39 | } while (0) | ||
40 | #endif | ||
41 | |||
42 | #ifndef WARN_ON | ||
35 | #define WARN_ON(condition) ({ \ | 43 | #define WARN_ON(condition) ({ \ |
36 | int __ret_warn_on = !!(condition); \ | 44 | int __ret_warn_on = !!(condition); \ |
37 | if (unlikely(__ret_warn_on)) { \ | 45 | if (unlikely(__ret_warn_on)) \ |
38 | printk("WARNING: at %s:%d %s()\n", __FILE__, \ | 46 | __WARN(); \ |
39 | __LINE__, __FUNCTION__); \ | ||
40 | dump_stack(); \ | ||
41 | } \ | ||
42 | unlikely(__ret_warn_on); \ | 47 | unlikely(__ret_warn_on); \ |
43 | }) | 48 | }) |
44 | #endif | 49 | #endif |