aboutsummaryrefslogtreecommitdiff
path: root/arch/x86/include/asm/es7000
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/include/asm/es7000')
-rw-r--r--arch/x86/include/asm/es7000/apic.h19
1 files changed, 10 insertions, 9 deletions
diff --git a/arch/x86/include/asm/es7000/apic.h b/arch/x86/include/asm/es7000/apic.h
index c2bed772af8..ba8423c5363 100644
--- a/arch/x86/include/asm/es7000/apic.h
+++ b/arch/x86/include/asm/es7000/apic.h
@@ -214,8 +214,8 @@ static inline unsigned int cpu_mask_to_apicid(const cpumask_t *cpumask)
return apicid;
}
-static inline unsigned int cpu_mask_to_apicid_and(const cpumask_t *cpumask,
- const cpumask_t *andmask)
+static inline unsigned int cpu_mask_to_apicid_and(const struct cpumask *cpumask,
+ const struct cpumask *andmask)
{
int num_bits_set;
int num_bits_set2;
@@ -223,9 +223,9 @@ static inline unsigned int cpu_mask_to_apicid_and(const cpumask_t *cpumask,
int cpu;
int apicid = 0;
- num_bits_set = cpus_weight(*cpumask);
- num_bits_set2 = cpus_weight(*andmask);
- num_bits_set = min_t(int, num_bits_set, num_bits_set2);
+ num_bits_set = cpumask_weight(cpumask);
+ num_bits_set2 = cpumask_weight(andmask);
+ num_bits_set = min(num_bits_set, num_bits_set2);
/* Return id to all */
if (num_bits_set >= nr_cpu_ids)
#if defined CONFIG_ES7000_CLUSTERED_APIC
@@ -237,11 +237,12 @@ static inline unsigned int cpu_mask_to_apicid_and(const cpumask_t *cpumask,
* The cpus in the mask must all be on the apic cluster. If are not
* on the same apicid cluster return default value of TARGET_CPUS.
*/
- while ((cpu = next_cpu(-1, *cpumask)) < nr_cpu_ids)
- if (cpu_isset(cpu, *andmask)
- apicid = cpu_to_logical_apicid(cpu);
+ cpu = cpumask_first_and(cpumask, andmask);
+ apicid = cpu_to_logical_apicid(cpu);
+
while (cpus_found < num_bits_set) {
- if (cpu_isset(cpu, *cpumask) && cpu_isset(cpu, *andmask)) {
+ if (cpumask_test_cpu(cpu, cpumask) &&
+ cpumask_test_cpu(cpu, andmask)) {
int new_apicid = cpu_to_logical_apicid(cpu);
if (apicid_cluster(apicid) !=
apicid_cluster(new_apicid)) {