Messages in this thread Patch in this message | | | Date | Fri, 18 Jul 2008 18:11:29 -0700 | From | Mike Travis <> | Subject | [PATCH 3/8] NR_CPUS: Replace NR_CPUS in arch/x86/kernel/genx2apic_uv_x.c |
| |
* 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@sgi.com> Cc: Jack Steiner <steiner@sgi.com> --- 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; --
| |