aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/sn
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2009-03-15 23:42:42 -0400
committerRusty Russell <rusty@rustcorp.com.au>2009-03-15 23:42:42 -0400
commit5dd3c9949a3e92ea7fd8c75d888031f7aff1f1d0 (patch)
tree18e60117e1e547fe1e973e67a43754a3d8538104 /arch/ia64/sn
parent40fe697a1759b85f5e06c490599f4f7b03de3be7 (diff)
cpumask: prepare for iterators to only go to nr_cpu_ids/nr_cpumask_bits.: ia64
Impact: cleanup, futureproof In fact, all cpumask ops will only be valid (in general) for bit numbers < nr_cpu_ids. So use that instead of NR_CPUS in various places. This is always safe: no cpu number can be >= nr_cpu_ids, and nr_cpu_ids is initialized to NR_CPUS at boot. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Mike Travis <travis@sgi.com> Acked-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/ia64/sn')
-rw-r--r--arch/ia64/sn/kernel/setup.c2
-rw-r--r--arch/ia64/sn/kernel/sn2/sn2_smp.c6
-rw-r--r--arch/ia64/sn/kernel/sn2/sn_hwperf.c2
3 files changed, 5 insertions, 5 deletions
diff --git a/arch/ia64/sn/kernel/setup.c b/arch/ia64/sn/kernel/setup.c
index 02c5b8a9fb60..12097776afc0 100644
--- a/arch/ia64/sn/kernel/setup.c
+++ b/arch/ia64/sn/kernel/setup.c
@@ -750,7 +750,7 @@ nasid_slice_to_cpuid(int nasid, int slice)
750{ 750{
751 long cpu; 751 long cpu;
752 752
753 for (cpu = 0; cpu < NR_CPUS; cpu++) 753 for (cpu = 0; cpu < nr_cpu_ids; cpu++)
754 if (cpuid_to_nasid(cpu) == nasid && 754 if (cpuid_to_nasid(cpu) == nasid &&
755 cpuid_to_slice(cpu) == slice) 755 cpuid_to_slice(cpu) == slice)
756 return cpu; 756 return cpu;
diff --git a/arch/ia64/sn/kernel/sn2/sn2_smp.c b/arch/ia64/sn/kernel/sn2/sn2_smp.c
index e585f9a2afb9..209e1eb467da 100644
--- a/arch/ia64/sn/kernel/sn2/sn2_smp.c
+++ b/arch/ia64/sn/kernel/sn2/sn2_smp.c
@@ -461,7 +461,7 @@ bool sn_cpu_disable_allowed(int cpu)
461 461
462static void *sn2_ptc_seq_start(struct seq_file *file, loff_t * offset) 462static void *sn2_ptc_seq_start(struct seq_file *file, loff_t * offset)
463{ 463{
464 if (*offset < NR_CPUS) 464 if (*offset < nr_cpu_ids)
465 return offset; 465 return offset;
466 return NULL; 466 return NULL;
467} 467}
@@ -469,7 +469,7 @@ static void *sn2_ptc_seq_start(struct seq_file *file, loff_t * offset)
469static void *sn2_ptc_seq_next(struct seq_file *file, void *data, loff_t * offset) 469static void *sn2_ptc_seq_next(struct seq_file *file, void *data, loff_t * offset)
470{ 470{
471 (*offset)++; 471 (*offset)++;
472 if (*offset < NR_CPUS) 472 if (*offset < nr_cpu_ids)
473 return offset; 473 return offset;
474 return NULL; 474 return NULL;
475} 475}
@@ -491,7 +491,7 @@ static int sn2_ptc_seq_show(struct seq_file *file, void *data)
491 seq_printf(file, "# ptctest %d, flushopt %d\n", sn2_ptctest, sn2_flush_opt); 491 seq_printf(file, "# ptctest %d, flushopt %d\n", sn2_ptctest, sn2_flush_opt);
492 } 492 }
493 493
494 if (cpu < NR_CPUS && cpu_online(cpu)) { 494 if (cpu < nr_cpu_ids && cpu_online(cpu)) {
495 stat = &per_cpu(ptcstats, cpu); 495 stat = &per_cpu(ptcstats, cpu);
496 seq_printf(file, "cpu %d %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld\n", cpu, stat->ptc_l, 496 seq_printf(file, "cpu %d %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld\n", cpu, stat->ptc_l,
497 stat->change_rid, stat->shub_ptc_flushes, stat->nodes_flushed, 497 stat->change_rid, stat->shub_ptc_flushes, stat->nodes_flushed,
diff --git a/arch/ia64/sn/kernel/sn2/sn_hwperf.c b/arch/ia64/sn/kernel/sn2/sn_hwperf.c
index be339477f906..45f3c2390428 100644
--- a/arch/ia64/sn/kernel/sn2/sn_hwperf.c
+++ b/arch/ia64/sn/kernel/sn2/sn_hwperf.c
@@ -612,7 +612,7 @@ static int sn_hwperf_op_cpu(struct sn_hwperf_op_info *op_info)
612 op_info->a->arg &= SN_HWPERF_ARG_OBJID_MASK; 612 op_info->a->arg &= SN_HWPERF_ARG_OBJID_MASK;
613 613
614 if (cpu != SN_HWPERF_ARG_ANY_CPU) { 614 if (cpu != SN_HWPERF_ARG_ANY_CPU) {
615 if (cpu >= NR_CPUS || !cpu_online(cpu)) { 615 if (cpu >= nr_cpu_ids || !cpu_online(cpu)) {
616 r = -EINVAL; 616 r = -EINVAL;
617 goto out; 617 goto out;
618 } 618 }