Skip to contentSkip to conversation

add __LINE__ to out_of_line_bug()

PATCH New Andrew Morton 1 participant 1 message Apr 16, 2002

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 add __LINE__ to out_of_line_bug()

include/linux/kernel.h renamed from include/linux/kernel.h~oolb +2 -1
@@ -162,7 +162,8 @@ extern const char *print_tainted(void);
 #define max_t(type,x,y) \
 	({ type __x = (x); type __y = (y); __x > __y ? __x: __y; })
 
-extern void out_of_line_bug(void) ATTRIB_NORET;
+extern void __out_of_line_bug(int line) ATTRIB_NORET;
+#define out_of_line_bug() __out_of_line_bug(__LINE__)
 
 #endif /* __KERNEL__ */
 
kernel/panic.c renamed from kernel/panic.c~oolb +3 -1
@@ -134,8 +134,10 @@ int tainted = 0;
  * tells us what we want to know.
  */
 
-void out_of_line_bug(void)
+void __out_of_line_bug(int line)
 {
+	printk("kernel BUG in header file at line %d\n", line);
+
 	BUG();
 
 	/* Satisfy __attribute__((noreturn)) */
kernel/ksyms.c renamed from kernel/ksyms.c~oolb +1 -1
@@ -454,7 +454,7 @@ EXPORT_SYMBOL(nr_running);
 
 /* misc */
 EXPORT_SYMBOL(panic);
-EXPORT_SYMBOL(out_of_line_bug);
+EXPORT_SYMBOL(__out_of_line_bug);
 EXPORT_SYMBOL(sprintf);
 EXPORT_SYMBOL(snprintf);
 EXPORT_SYMBOL(sscanf);