Skip to contentSkip to conversation

x86: use cpumask_t instead of unsigned long

PATCH New Siddha, Suresh B 1 participant 1 message Jan 14, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: use cpumask_t instead of unsigned long

Current code can lead to corruption. Please apply the fix.

thanks,
suresh
--

Use cpumask_t instead of unsigned long.

arch/i386/kernel/cpu/common.c +2 -2
diff -Nru linux-2.6.10/arch/i386/kernel/cpu/common.c linux-cpumask/arch/i386/kernel/cpu/common.c
@@ -455,7 +455,7 @@
 		printk("\n");
 }
 
-unsigned long cpu_initialized __initdata = 0;
+cpumask_t cpu_initialized __initdata = CPU_MASK_NONE;
 
 /* This is hacky. :)
  * We're emulating future behavior.
@@ -509,7 +509,7 @@
 	struct tss_struct * t = &per_cpu(init_tss, cpu);
 	struct thread_struct *thread = &current->thread;
 
-	if (test_and_set_bit(cpu, &cpu_initialized)) {
+	if (cpu_test_and_set(cpu, cpu_initialized)) {
 		printk(KERN_WARNING "CPU#%d already initialized!\n", cpu);
 		for (;;) local_irq_enable();
 	}