
From: Dumitru Ciobarcianu <Dumitru.Ciobarcianu@iNES.RO>




 arch/i386/kernel/cpu/cpufreq/p4-clockmod.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff -puN arch/i386/kernel/cpu/cpufreq/p4-clockmod.c~p4-clockmod-cpumask-fix arch/i386/kernel/cpu/cpufreq/p4-clockmod.c
--- 25/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c~p4-clockmod-cpumask-fix	2003-07-03 08:33:43.000000000 -0700
+++ 25-akpm/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c	2003-07-03 08:33:43.000000000 -0700
@@ -53,10 +53,9 @@ static int stock_freq;
 static int cpufreq_p4_setdc(unsigned int cpu, unsigned int newstate)
 {
 	u32 l, h;
-	unsigned long cpus_allowed;
+	cpumask_t cpus_allowed, affected_cpu_map;
 	struct cpufreq_freqs freqs;
 	int hyperthreading = 0;
-	int affected_cpu_map = 0;
 	int sibling = 0;
 
 	if (!cpu_online(cpu) || (newstate > DC_DISABLE) || 
@@ -67,16 +66,16 @@ static int cpufreq_p4_setdc(unsigned int
 	cpus_allowed = current->cpus_allowed;
 
 	/* only run on CPU to be set, or on its sibling */
-	affected_cpu_map = 1 << cpu;
+       affected_cpu_map = cpumask_of_cpu(cpu);
 #ifdef CONFIG_X86_HT
 	hyperthreading = ((cpu_has_ht) && (smp_num_siblings == 2));
 	if (hyperthreading) {
 		sibling = cpu_sibling_map[cpu];
-		affected_cpu_map |= (1 << sibling);
+                cpu_set(sibling, affected_cpu_map);
 	}
 #endif
 	set_cpus_allowed(current, affected_cpu_map);
-	BUG_ON(!(affected_cpu_map & (1 << smp_processor_id())));
+        BUG_ON(!cpu_isset(smp_processor_id(), affected_cpu_map));
 
 	/* get current state */
 	rdmsr(MSR_IA32_THERM_CONTROL, l, h);

_
