aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/genx2apic_uv_x.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-01-28 09:20:18 -0500
committerIngo Molnar <mingo@elte.hu>2009-01-28 17:20:30 -0500
commitdebccb3e77be52cfc26c5a99e123c114c5c72aeb (patch)
tree27c015b45085b2042737d94a3fbd3c62fe143c37 /arch/x86/kernel/genx2apic_uv_x.c
parent94af18755266edf46803564414d74f9621aaded8 (diff)
x86, apic: refactor ->cpu_mask_to_apicid*()
- spread out the namespace on a per driver basis - clean up the functions - get rid of macros Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/genx2apic_uv_x.c')
-rw-r--r--arch/x86/kernel/genx2apic_uv_x.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/arch/x86/kernel/genx2apic_uv_x.c b/arch/x86/kernel/genx2apic_uv_x.c
index 50310b96adc3..f957878c21e9 100644
--- a/arch/x86/kernel/genx2apic_uv_x.c
+++ b/arch/x86/kernel/genx2apic_uv_x.c
@@ -171,21 +171,21 @@ static void uv_init_apic_ldr(void)
171 171
172static unsigned int uv_cpu_mask_to_apicid(const struct cpumask *cpumask) 172static unsigned int uv_cpu_mask_to_apicid(const struct cpumask *cpumask)
173{ 173{
174 int cpu;
175
176 /* 174 /*
177 * We're using fixed IRQ delivery, can only return one phys APIC ID. 175 * We're using fixed IRQ delivery, can only return one phys APIC ID.
178 * May as well be the first. 176 * May as well be the first.
179 */ 177 */
180 cpu = cpumask_first(cpumask); 178 int cpu = cpumask_first(cpumask);
179
181 if ((unsigned)cpu < nr_cpu_ids) 180 if ((unsigned)cpu < nr_cpu_ids)
182 return per_cpu(x86_cpu_to_apicid, cpu); 181 return per_cpu(x86_cpu_to_apicid, cpu);
183 else 182 else
184 return BAD_APICID; 183 return BAD_APICID;
185} 184}
186 185
187static unsigned int uv_cpu_mask_to_apicid_and(const struct cpumask *cpumask, 186static unsigned int
188 const struct cpumask *andmask) 187uv_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
188 const struct cpumask *andmask)
189{ 189{
190 int cpu; 190 int cpu;
191 191
@@ -193,11 +193,13 @@ static unsigned int uv_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
193 * We're using fixed IRQ delivery, can only return one phys APIC ID. 193 * We're using fixed IRQ delivery, can only return one phys APIC ID.
194 * May as well be the first. 194 * May as well be the first.
195 */ 195 */
196 for_each_cpu_and(cpu, cpumask, andmask) 196 for_each_cpu_and(cpu, cpumask, andmask) {
197 if (cpumask_test_cpu(cpu, cpu_online_mask)) 197 if (cpumask_test_cpu(cpu, cpu_online_mask))
198 break; 198 break;
199 }
199 if (cpu < nr_cpu_ids) 200 if (cpu < nr_cpu_ids)
200 return per_cpu(x86_cpu_to_apicid, cpu); 201 return per_cpu(x86_cpu_to_apicid, cpu);
202
201 return BAD_APICID; 203 return BAD_APICID;
202} 204}
203 205