Skip to contentSkip to conversation

consolidate oops end/ID printing code in panic.c

PATCH In review Arjan van de Ven 1 participant 1 message Jan 3, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 3/3 consolidate oops end/ID printing code in panic.c

Subject: consolidate oops end/ID printing code in panic.c
From: Arjan van de Ven <[email protected]>
CC: Ingo Molnar <[email protected]>
CC: Andrew Morton <[email protected]>

This patch consolidates the 2 places that print an oops end marker and ID into a single function; this patch follows the WARN_ON uninline and the WARN_ON enhancement patches.

---
 kernel/panic.c |   15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)
kernel/panic.c +9 -6
Index: linux-2.6.24-rc6/kernel/panic.c
===================================================================
@@ -281,6 +281,13 @@ static int init_oops_id(void)
 }
 late_initcall(init_oops_id);
 
+static void print_oops_end_marker(void)
+{
+	init_oops_id();
+	printk(KERN_WARNING "---[ end trace %016llx ]---\n",
+		(unsigned long long)oops_id);
+}
+
 /*
  * Called when the architecture exits its oops handler, after printing
  * everything.
@@ -288,9 +295,7 @@ late_initcall(init_oops_id);
 void oops_exit(void)
 {
 	do_oops_enter_exit();
-	init_oops_id();
-	printk(KERN_WARNING "---[ end trace %016llx ]---\n",
-		(unsigned long long)oops_id);
+	print_oops_end_marker();
 }
 
 int do_warn_on(const unsigned long condition, const char *file,
@@ -302,9 +307,7 @@ int do_warn_on(const unsigned long condi
 			__FILE__, __LINE__, __FUNCTION__);
 		print_modules();
 		dump_stack();
-		init_oops_id();
-		printk(KERN_WARNING "---[ end trace %016llx ]---\n",
-			(unsigned long long)oops_id);
+		print_oops_end_marker();
 	}
 	return !!condition;
 }