diff options
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..2632328d8646 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 | #ifndef __ASSEMBLY__ | ||
36 | extern void warn_on_slowpath(const char *file, const int line); | ||
37 | #define WANT_WARN_ON_SLOWPATH | ||
38 | #endif | ||
39 | #define __WARN() warn_on_slowpath(__FILE__, __LINE__) | ||
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 |