From: Olof Johansson Date: Wed, 30 Jan 2008 12:32:50 +0000 (+0100) Subject: debug: introduce __WARN() X-Git-Tag: v2.6.25-rc1~1143^2~387 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=3a6a62f96f168d192fb0cc9c0b5ee2584740b32d;p=linux-2.6-omap-h63xx.git 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 Cc: Signed-off-by: Andrew Morton Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h index d56fedbb457..1a0e1a7684b 100644 --- a/include/asm-generic/bug.h +++ b/include/asm-generic/bug.h @@ -31,14 +31,19 @@ struct bug_entry { #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while(0) #endif -#ifndef HAVE_ARCH_WARN_ON +#ifndef __WARN +#define __WARN() do { \ + printk("WARNING: at %s:%d %s()\n", __FILE__, \ + __LINE__, __FUNCTION__); \ + dump_stack(); \ +} while (0) +#endif + +#ifndef WARN_ON #define WARN_ON(condition) ({ \ int __ret_warn_on = !!(condition); \ - if (unlikely(__ret_warn_on)) { \ - printk("WARNING: at %s:%d %s()\n", __FILE__, \ - __LINE__, __FUNCTION__); \ - dump_stack(); \ - } \ + if (unlikely(__ret_warn_on)) \ + __WARN(); \ unlikely(__ret_warn_on); \ }) #endif