From: Mike Travis <travis@sgi.com>
To: Ingo Molnar <mingo@elte.hu>, Andrew Morton <akpm@linux-foundation.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>, Jack Steiner <steiner@sgi.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH 3/8] NR_CPUS: Replace NR_CPUS in arch/x86/kernel/genx2apic_uv_x.c
Date: Fri, 18 Jul 2008 18:11:29 -0700 [thread overview]
Message-ID: <20080719011127.395716000@polaris-admin.engr.sgi.com> (raw)
In-Reply-To: <20080719011126.745278000@polaris-admin.engr.sgi.com>
[-- Attachment #1: repl-NR_CPUS-in-arch_x86_kernel_genx2apic_uv_x_c --]
[-- Type: text/plain, Size: 966 bytes --]
* 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;
--
next prev parent reply other threads:[~2008-07-19 1:11 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-19 1:11 [PATCH 0/8] NR_CPUS: Various replacements for NR_CPUS Mike Travis
2008-07-19 1:11 ` [PATCH 1/8] NR_CPUS: Replace NR_CPUS in arch/x86/kernel/cpu/mcheck/mce_64.c Mike Travis
2008-07-19 1:11 ` [PATCH 2/8] NR_CPUS: Replace NR_CPUS in arch/x86/kernel/cpu/proc.c Mike Travis
2008-07-19 1:11 ` Mike Travis [this message]
2008-07-19 1:11 ` [PATCH 4/8] NR_CPUS: Replace NR_CPUS in arch/x86/kernel/genapic_flat_64.c Mike Travis
2008-07-19 1:11 ` [PATCH 5/8] NR_CPUS: Replace per_cpu(..., smp_processor_id()) with __get_cpu_var Mike Travis
2008-07-19 1:11 ` [PATCH 6/8] NR_CPUS: Replace NR_CPUS in cpufreq userspace routines Mike Travis
2008-07-19 1:11 ` [PATCH 7/8] cpumask: Provide a generic set of CPUMASK_ALLOC macros, FIXUP Mike Travis
2008-07-19 1:11 ` [PATCH 8/8] NR_CPUS: Replace NR_CPUS in speedstep-centrino.c Mike Travis
2008-07-20 8:23 ` [PATCH 0/8] NR_CPUS: Various replacements for NR_CPUS Ingo Molnar
2008-07-21 17:17 ` Mike Travis
2008-07-21 21:01 ` Mike Travis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080719011127.395716000@polaris-admin.engr.sgi.com \
--to=travis@sgi.com \
--cc=akpm@linux-foundation.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=steiner@sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®