diff options
author | Matt Mackall <mpm@selenic.com> | 2005-05-01 11:59:01 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-05-01 11:59:01 -0400 |
commit | c8538a7aa5527d02c7191ac5da124efadf6a2827 (patch) | |
tree | 6a2fae8be308d38ed1abe1d5c7539db29238ae61 /include/asm-generic/bug.h | |
parent | e43379f10b42194b8a6e1de342cfb44463c0f6da (diff) |
[PATCH] remove all kernel BUGs
This patch eliminates all kernel BUGs, trims about 35k off the typical
kernel, and makes the system slightly faster.
Signed-off-by: Matt Mackall <mpm@selenic.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/asm-generic/bug.h')
-rw-r--r-- | include/asm-generic/bug.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h index e5913c3b715a..6e5aaaa9a2fb 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__); \ |
@@ -31,4 +32,22 @@ | |||
31 | } while (0) | 32 | } while (0) |
32 | #endif | 33 | #endif |
33 | 34 | ||
35 | #else /* !CONFIG_BUG */ | ||
36 | #ifndef HAVE_ARCH_BUG | ||
37 | #define BUG() | ||
38 | #endif | ||
39 | |||
40 | #ifndef HAVE_ARCH_PAGE_BUG | ||
41 | #define PAGE_BUG(page) do { if (page) ; } while (0) | ||
42 | #endif | ||
43 | |||
44 | #ifndef HAVE_ARCH_BUG_ON | ||
45 | #define BUG_ON(condition) do { if (condition) ; } while(0) | ||
46 | #endif | ||
47 | |||
48 | #ifndef HAVE_ARCH_WARN_ON | ||
49 | #define WARN_ON(condition) do { if (condition) ; } while(0) | ||
50 | #endif | ||
51 | #endif | ||
52 | |||
34 | #endif | 53 | #endif |