[PATCH 3/8] NR_CPUS: Replace NR_CPUS in arch/x86/kernel/genx2apic_uv_x.c

From: Mike Travis
Date: Fri Jul 18 2008 - 21:11:52 EST


* Replace NR_CPUS loop with for_each_possible_cpu().

* nr_cpu_ids should be used to determine if a percpu area is
available for a given cpu.

Applies to both tip/master and linux-next.

Signed-off-by: Mike Travis <travis@xxxxxxx>
Cc: Jack Steiner <steiner@xxxxxxx>
---
arch/x86/kernel/genx2apic_uv_x.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

--- linux-2.6.tip.orig/arch/x86/kernel/genx2apic_uv_x.c
+++ linux-2.6.tip/arch/x86/kernel/genx2apic_uv_x.c
@@ -98,7 +98,7 @@ static void uv_send_IPI_mask(cpumask_t m
{
unsigned int cpu;

- for (cpu = 0; cpu < NR_CPUS; ++cpu)
+ for_each_possible_cpu(cpu)
if (cpu_isset(cpu, mask))
uv_send_IPI_one(cpu, vector);
}
@@ -132,7 +132,7 @@ static unsigned int uv_cpu_mask_to_apici
* May as well be the first.
*/
cpu = first_cpu(cpumask);
- if ((unsigned)cpu < NR_CPUS)
+ if ((unsigned)cpu < nr_cpu_ids)
return per_cpu(x86_cpu_to_apicid, cpu);
else
return BAD_APICID;

--
--
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/