linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Ghozlane Toumi <ghoz@sympatico.ca>
Cc: linux-kernel@vger.kernel.org, torvalds@transmeta.com
Subject: Re: [PATCH] Fix BUG macro
Date: Fri, 17 May 2002 12:25:05 +1000	[thread overview]
Message-ID: <E178XQX-0000tw-00@wagner.rustcorp.com.au> (raw)
In-Reply-To: Your message of "Thu, 16 May 2002 12:27:55 -0400." <20020516162841.PYWL19243.tomts15-srv.bellnexxia.net@there>

In message <20020516162841.PYWL19243.tomts15-srv.bellnexxia.net@there> you writ
e:
> Minor nit : any reason why you don't use  __stringify from 
> include/linux/stringify.h ?

Ignorance.  Mea culpa.  Linus, please apply.

diff -urN -I \$.*\$ --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal linux-2.5.15/arch/i386/kernel/traps.c working-2.5.15-bug/arch/i386/kernel/traps.c
--- linux-2.5.15/arch/i386/kernel/traps.c	Tue Apr 23 11:39:32 2002
+++ working-2.5.15-bug/arch/i386/kernel/traps.c	Fri May 17 12:23:06 2002
@@ -245,7 +245,7 @@
 {
 	unsigned short ud2;
 	unsigned short line;
-	char *file;
+	char *object, *func;
 	char c;
 	unsigned long eip;
 
@@ -262,11 +262,14 @@
 		goto no_bug;
 	if (__get_user(line, (unsigned short *)(eip + 2)))
 		goto bug;
-	if (__get_user(file, (char **)(eip + 4)) ||
-		(unsigned long)file < PAGE_OFFSET || __get_user(c, file))
-		file = "<bad filename>";
+	if (__get_user(object, (char **)(eip + 4)) ||
+		(unsigned long)object < PAGE_OFFSET || __get_user(c, object))
+		object = "<bad objectname>";
+	if (__get_user(func, (char **)(eip + 8)) ||
+		(unsigned long)func < PAGE_OFFSET || __get_user(c, func))
+		func = "<bad funcname>";
 
-	printk("kernel BUG at %s:%d!\n", file, line);
+	printk("kernel BUG at %s:%s:%d!\n", object, func, line);
 
 no_bug:
 	return;
diff -urN -I \$.*\$ --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal linux-2.5.15/include/asm-i386/page.h working-2.5.15-bug/include/asm-i386/page.h
--- linux-2.5.15/include/asm-i386/page.h	Mon May  6 16:00:10 2002
+++ working-2.5.15-bug/include/asm-i386/page.h	Fri May 17 12:23:59 2002
@@ -10,6 +10,7 @@
 #ifndef __ASSEMBLY__
 
 #include <linux/config.h>
+#include <linux/stringify.h>
 
 #ifdef CONFIG_X86_USE_3DNOW
 
@@ -100,7 +101,10 @@
  __asm__ __volatile__(	"ud2\n"		\
 			"\t.word %c0\n"	\
 			"\t.long %c1\n"	\
-			 : : "i" (__LINE__), "i" (__FILE__))
+			"\t.long %c2\n"	\
+			 : : "i" (__LINE__), \
+			"i" (__stringify(KBUILD_BASENAME)), \
+			"i" (__FUNCTION__))
 #else
 #define BUG() __asm__ __volatile__("ud2\n")
 #endif
--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.

  reply	other threads:[~2002-05-17  2:21 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-16  8:08 [PATCH] Fix BUG macro Rusty Russell
2002-05-16 11:21 ` Hugh Dickins
2002-05-17  0:31   ` Rusty Russell
2002-05-17  7:56     ` Hugh Dickins
2002-05-17  9:43       ` Rusty Russell
2002-05-17 11:47         ` Hugh Dickins
2002-05-17 12:02           ` Andreas Schwab
2002-05-17 12:46           ` Rusty Russell
2002-05-17 13:19             ` Hugh Dickins
2002-05-16 16:27 ` Ghozlane Toumi
2002-05-17  2:25   ` Rusty Russell [this message]
2002-05-17  2:41     ` Andrew Morton
2002-05-17  4:25       ` Rusty Russell
2002-05-17  4:50         ` Andrew Morton
2002-05-17  5:20           ` Rusty Russell
2002-05-17  6:44             ` Andrew Morton
2002-05-17  9:39               ` Rusty Russell
2002-05-17 16:14                 ` Kai Germaschewski
2002-05-17 18:41                   ` Andrew Morton
2002-05-17 22:35                     ` Stevie O
2002-05-17 23:09                       ` Kai Germaschewski
2002-05-18  6:28                     ` Linus Torvalds

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=E178XQX-0000tw-00@wagner.rustcorp.com.au \
    --to=rusty@rustcorp.com.au \
    --cc=ghoz@sympatico.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /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;
as well as URLs for NNTP newsgroup(s).