Skip to contentSkip to conversation

x86, UV: remove recursion in uv_heartbeat_enable()

PATCH In review Roel Kluin 1 participant 2 messages Jan 7, 2010 – Jan 9, 2010

Subsystems (2)
lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 x86, UV: remove recursion in uv_heartbeat_enable()

The recursion is not needed and does not improve readability.

---
 arch/x86/kernel/apic/x2apic_uv_x.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)
arch/x86/kernel/apic/x2apic_uv_x.c +4 -5
index 8edb27c..fcc3f4a 100644
@@ -473,7 +473,7 @@ static void uv_heartbeat(unsigned long ignored)
 
 static void __cpuinit uv_heartbeat_enable(int cpu)
 {
-	if (!uv_cpu_hub_info(cpu)->scir.enabled) {
+	while (!uv_cpu_hub_info(cpu)->scir.enabled) {
 		struct timer_list *timer = &uv_cpu_hub_info(cpu)->scir.timer;
 
 		uv_set_cpu_scir_bits(cpu, SCIR_CPU_HEARTBEAT|SCIR_CPU_ACTIVITY);
@@ -481,11 +481,10 @@ static void __cpuinit uv_heartbeat_enable(int cpu)
 		timer->expires = jiffies + SCIR_CPU_HB_INTERVAL;
 		add_timer_on(timer, cpu);
 		uv_cpu_hub_info(cpu)->scir.enabled = 1;
-	}
 
-	/* check boot cpu */
-	if (!uv_cpu_hub_info(0)->scir.enabled)
-		uv_heartbeat_enable(0);
+		/* also ensure that boot cpu is enabled */
+		cpu = 0;
+	}
 }
 
 #ifdef CONFIG_HOTPLUG_CPU
#1 lore raw

[tip:x86/uv] x86, uv: Remove recursion in uv_heartbeat_enable()

Commit-ID:  99659a929d653d0c9ce458091870544768add871
Gitweb:     http://git.kernel.org/tip/99659a929d653d0c9ce458091870544768add871
Author:     Roel Kluin <[email protected]>
AuthorDate: Thu, 7 Jan 2010 15:35:42 +0100
Committer:  H. Peter Anvin <[email protected]>
CommitDate: Thu, 7 Jan 2010 11:50:06 -0800

x86, uv: Remove recursion in uv_heartbeat_enable()

The recursion is not needed and does not improve readability.

LKML-Reference: <[email protected]>

---
 arch/x86/kernel/apic/x2apic_uv_x.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)
arch/x86/kernel/apic/x2apic_uv_x.c +4 -5
index af5d103..d199dc3 100644
@@ -475,7 +475,7 @@ static void uv_heartbeat(unsigned long ignored)
 
 static void __cpuinit uv_heartbeat_enable(int cpu)
 {
-	if (!uv_cpu_hub_info(cpu)->scir.enabled) {
+	while (!uv_cpu_hub_info(cpu)->scir.enabled) {
 		struct timer_list *timer = &uv_cpu_hub_info(cpu)->scir.timer;
 
 		uv_set_cpu_scir_bits(cpu, SCIR_CPU_HEARTBEAT|SCIR_CPU_ACTIVITY);
@@ -483,11 +483,10 @@ static void __cpuinit uv_heartbeat_enable(int cpu)
 		timer->expires = jiffies + SCIR_CPU_HB_INTERVAL;
 		add_timer_on(timer, cpu);
 		uv_cpu_hub_info(cpu)->scir.enabled = 1;
-	}
 
-	/* check boot cpu */
-	if (!uv_cpu_hub_info(0)->scir.enabled)
-		uv_heartbeat_enable(0);
+		/* also ensure that boot cpu is enabled */
+		cpu = 0;
+	}
 }
 
 #ifdef CONFIG_HOTPLUG_CPU