Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c8538a7a authored by Matt Mackall's avatar Matt Mackall Committed by Linus Torvalds
Browse files

[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: default avatarMatt Mackall <mpm@selenic.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent e43379f1
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
#ifndef _ALPHA_BUG_H
#define _ALPHA_BUG_H

#ifdef CONFIG_BUG
#include <asm/pal.h>

/* ??? Would be nice to use .gprel32 here, but we can't be sure that the
@@ -10,6 +11,8 @@
		       : : "i" (PAL_bugchk), "i"(__LINE__), "i"(__FILE__))

#define HAVE_ARCH_BUG
#endif

#include <asm-generic/bug.h>

#endif
+3 −0
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@

#include <linux/config.h>

#ifdef CONFIG_BUG
#ifdef CONFIG_DEBUG_BUGVERBOSE
extern volatile void __bug(const char *file, int line, void *data);

@@ -17,6 +18,8 @@ extern volatile void __bug(const char *file, int line, void *data);
#endif

#define HAVE_ARCH_BUG
#endif

#include <asm-generic/bug.h>

#endif
+3 −0
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@

#include <linux/config.h>

#ifdef CONFIG_BUG
#ifdef CONFIG_DEBUG_BUGVERBOSE
extern volatile void __bug(const char *file, int line, void *data);
/* give file/line information */
@@ -12,6 +13,8 @@ extern volatile void __bug(const char *file, int line, void *data);
#endif

#define HAVE_ARCH_BUG
#endif

#include <asm-generic/bug.h>

#endif
+2 −0
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@

#include <linux/config.h>

#ifdef CONFIG_BUG
/*
 * Tell the user there is some problem.
 */
@@ -45,6 +46,7 @@ do { \
#define HAVE_ARCH_KGDB_BAD_PAGE
#define kgdb_bad_page(page) do { kgdb_raise(SIGABRT); } while(0)
#endif
#endif

#include <asm-generic/bug.h>

+19 −0
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@
#include <linux/compiler.h>
#include <linux/config.h>

#ifdef CONFIG_BUG
#ifndef HAVE_ARCH_BUG
#define BUG() do { \
	printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
@@ -31,4 +32,22 @@
} while (0)
#endif

#else /* !CONFIG_BUG */
#ifndef HAVE_ARCH_BUG
#define BUG()
#endif

#ifndef HAVE_ARCH_PAGE_BUG
#define PAGE_BUG(page) do { if (page) ; } while (0)
#endif

#ifndef HAVE_ARCH_BUG_ON
#define BUG_ON(condition) do { if (condition) ; } while(0)
#endif

#ifndef HAVE_ARCH_WARN_ON
#define WARN_ON(condition) do { if (condition) ; } while(0)
#endif
#endif

#endif
Loading