Commit 7c122fca authored by Dave Jones's avatar Dave Jones

[CPUFREQ] replace for_each_cpu with for_each_cpu_mask in p4-clockmod

From: Bruno Ducrot
Signed-off-by: default avatarDave Jones <davej@redhat.com>
parent d37e1fe9
...@@ -132,18 +132,15 @@ static int cpufreq_p4_target(struct cpufreq_policy *policy, ...@@ -132,18 +132,15 @@ static int cpufreq_p4_target(struct cpufreq_policy *policy,
#endif #endif
/* notifiers */ /* notifiers */
for_each_cpu(i) { for_each_cpu_mask(i, affected_cpu_map) {
if (cpu_isset(i, affected_cpu_map)) {
freqs.cpu = i; freqs.cpu = i;
cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
} }
}
/* run on each logical CPU, see section 13.15.3 of IA32 Intel Architecture Software /* run on each logical CPU, see section 13.15.3 of IA32 Intel Architecture Software
* Developer's Manual, Volume 3 * Developer's Manual, Volume 3
*/ */
for_each_cpu(i) { for_each_cpu_mask(i, affected_cpu_map) {
if (cpu_isset(i, affected_cpu_map)) {
cpumask_t this_cpu = cpumask_of_cpu(i); cpumask_t this_cpu = cpumask_of_cpu(i);
set_cpus_allowed(current, this_cpu); set_cpus_allowed(current, this_cpu);
...@@ -151,16 +148,13 @@ static int cpufreq_p4_target(struct cpufreq_policy *policy, ...@@ -151,16 +148,13 @@ static int cpufreq_p4_target(struct cpufreq_policy *policy,
cpufreq_p4_setdc(i, p4clockmod_table[newstate].index); cpufreq_p4_setdc(i, p4clockmod_table[newstate].index);
} }
}
set_cpus_allowed(current, cpus_allowed); set_cpus_allowed(current, cpus_allowed);
/* notifiers */ /* notifiers */
for_each_cpu(i) { for_each_cpu_mask(i, affected_cpu_map) {
if (cpu_isset(i, affected_cpu_map)) {
freqs.cpu = i; freqs.cpu = i;
cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
} }
}
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment