aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-generic/bug.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-generic/bug.h')
-rw-r--r--include/asm-generic/bug.h22
1 files changed, 15 insertions, 7 deletions
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h
index e5913c3b715a..400c2b41896e 100644
--- a/include/asm-generic/bug.h
+++ b/include/asm-generic/bug.h
@@ -4,6 +4,7 @@
4#include <linux/compiler.h> 4#include <linux/compiler.h>
5#include <linux/config.h> 5#include <linux/config.h>
6 6
7#ifdef CONFIG_BUG
7#ifndef HAVE_ARCH_BUG 8#ifndef HAVE_ARCH_BUG
8#define BUG() do { \ 9#define BUG() do { \
9 printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ 10 printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
@@ -11,13 +12,6 @@
11} while (0) 12} while (0)
12#endif 13#endif
13 14
14#ifndef HAVE_ARCH_PAGE_BUG
15#define PAGE_BUG(page) do { \
16 printk("page BUG for page at %p\n", page); \
17 BUG(); \
18} while (0)
19#endif
20
21#ifndef HAVE_ARCH_BUG_ON 15#ifndef HAVE_ARCH_BUG_ON
22#define BUG_ON(condition) do { if (unlikely((condition)!=0)) BUG(); } while(0) 16#define BUG_ON(condition) do { if (unlikely((condition)!=0)) BUG(); } while(0)
23#endif 17#endif
@@ -31,4 +25,18 @@
31} while (0) 25} while (0)
32#endif 26#endif
33 27
28#else /* !CONFIG_BUG */
29#ifndef HAVE_ARCH_BUG
30#define BUG()
31#endif
32
33#ifndef HAVE_ARCH_BUG_ON
34#define BUG_ON(condition) do { if (condition) ; } while(0)
35#endif
36
37#ifndef HAVE_ARCH_WARN_ON
38#define WARN_ON(condition) do { if (condition) ; } while(0)
39#endif
40#endif
41
34#endif 42#endif