mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Randy Dunlap <randy.dunlap@oracle.com>
To: lkml <linux-kernel@vger.kernel.org>
Cc: ak@suse.de, akpm <akpm@osdl.org>
Subject: [PATCH -mm] handle BUG=n
Date: Fri, 17 Nov 2006 21:52:40 -0800	[thread overview]
Message-ID: <20061117215240.cd49870d.randy.dunlap@oracle.com> (raw)

From: Randy Dunlap <randy.dunlap@oracle.com>

Handle BUG=n, GENERIC_BUG=n to prevent build errors:

arch/x86_64/kernel/built-in.o: In function `die':
(.text+0x3b3c): undefined reference to `report_bug'
arch/x86_64/kernel/built-in.o: In function `module_arch_cleanup':
(.text+0x10b60): undefined reference to `module_bug_cleanup'
arch/x86_64/kernel/built-in.o: In function `module_finalize':
(.text+0x10c98): undefined reference to `module_bug_finalize'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
---
 include/linux/bug.h |   26 ++++++++++++++++++++------
 1 file changed, 20 insertions(+), 6 deletions(-)

--- linux-2619-rc5mm2.orig/include/linux/bug.h
+++ linux-2619-rc5mm2/include/linux/bug.h
@@ -3,6 +3,12 @@
 
 #include <asm/bug.h>
 
+enum bug_trap_type {
+	BUG_TRAP_TYPE_NONE = 0,
+	BUG_TRAP_TYPE_WARN = 1,
+	BUG_TRAP_TYPE_BUG = 2,
+};
+
 #ifdef CONFIG_GENERIC_BUG
 #include <linux/module.h>
 #include <asm-generic/bug.h>
@@ -12,12 +18,6 @@ static inline int is_warning_bug(const s
 	return bug->flags & BUGFLAG_WARNING;
 }
 
-enum bug_trap_type {
-	BUG_TRAP_TYPE_NONE = 0,
-	BUG_TRAP_TYPE_WARN = 1,
-	BUG_TRAP_TYPE_BUG = 2,
-};
-
 const struct bug_entry *find_bug(unsigned long bugaddr);
 
 enum bug_trap_type report_bug(unsigned long bug_addr);
@@ -29,5 +29,19 @@ void module_bug_cleanup(struct module *)
 /* These are defined by the architecture */
 int is_valid_bugaddr(unsigned long addr);
 
+#else	/* !CONFIG_GENERIC_BUG */
+
+static inline enum bug_trap_type report_bug(unsigned long bug_addr)
+{
+	return BUG_TRAP_TYPE_BUG;
+}
+static inline int  module_bug_finalize(const Elf_Ehdr *hdr,
+					const Elf_Shdr *sechdrs,
+					struct module *mod)
+{
+	return 0;
+}
+static inline void module_bug_cleanup(struct module *mod) {}
+
 #endif	/* CONFIG_GENERIC_BUG */
 #endif	/* _LINUX_BUG_H */


---

                 reply	other threads:[~2006-11-18  5:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061117215240.cd49870d.randy.dunlap@oracle.com \
    --to=randy.dunlap@oracle.com \
    --cc=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome