[Patch] x86: use cpumask_t instead of unsigned long

From: Siddha, Suresh B
Date: Fri Jan 14 2005 - 16:44:12 EST


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

thanks,
suresh
--

Use cpumask_t instead of unsigned long.

Signed-off-by: Suresh Siddha <suresh.b.siddha@xxxxxxxxx>


diff -Nru linux-2.6.10/arch/i386/kernel/cpu/common.c linux-cpumask/arch/i386/kernel/cpu/common.c
--- linux-2.6.10/arch/i386/kernel/cpu/common.c 2004-12-24 13:33:50.000000000 -0800
+++ linux-cpumask/arch/i386/kernel/cpu/common.c 2005-01-14 11:45:39.876089160 -0800
@@ -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();
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/