Skip to contentSkip to conversation

x86: little cleanup of cpu_init()

PATCH In review Peter Zijlstra 2 participants 2 messages Jan 27, 2009 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: little cleanup of cpu_init()

While I was looking through the new and improved bootstrap code - great work that, thanks! I found the below a slight improvement.

---
 arch/x86/kernel/cpu/common.c |   25 +++++++++++--------------
 1 files changed, 11 insertions(+), 14 deletions(-)
arch/x86/kernel/cpu/common.c +11 -14
index 9394f73..5ecf97f 100644
@@ -1088,22 +1088,19 @@ void __cpuinit cpu_init(void)
 	 */
 	if (kgdb_connected && arch_kgdb_ops.correct_hw_break)
 		arch_kgdb_ops.correct_hw_break();
-	else {
+	else
 #endif
-	/*
-	 * Clear all 6 debug registers:
-	 */
-
-	set_debugreg(0UL, 0);
-	set_debugreg(0UL, 1);
-	set_debugreg(0UL, 2);
-	set_debugreg(0UL, 3);
-	set_debugreg(0UL, 6);
-	set_debugreg(0UL, 7);
-#ifdef CONFIG_KGDB
-	/* If the kgdb is connected no debug regs should be altered. */
+	{
+		/*
+		 * Clear all 6 debug registers:
+		 */
+		set_debugreg(0UL, 0);
+		set_debugreg(0UL, 1);
+		set_debugreg(0UL, 2);
+		set_debugreg(0UL, 3);
+		set_debugreg(0UL, 6);
+		set_debugreg(0UL, 7);
 	}
-#endif
 
 	fpu_init();
 
#1 lore raw
Quoted 4 lines · Peter Zijlstra

While I was looking through the new and improved bootstrap code - great work that, thanks! I found the below a slight improvement.

Applied to tip:x86/cleanups, thanks! Will push after quick test.

-hpa