aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2009-03-26 10:24:59 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2009-03-26 10:24:33 -0400
commit93632d1bf7447d445c6fc274c8931152f9412b56 (patch)
tree92034c77deb9dff69e62224acb6f7b2e40acc3dc /arch/s390
parent6f7a321d5feb0bc9aa7f7b14eceb1e6a63bff937 (diff)
[S390] cpumask: prepare for iterators to only go to nr_cpu_ids/nr_cpumask_bits.
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 (I also updated the immediate sites to use the new cpumask_ operators). 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> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/kernel/smp.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index fe5f8dc1e6fa..13052a4ed71d 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -297,8 +297,8 @@ static int smp_rescan_cpus_sigp(cpumask_t avail)
297{ 297{
298 int cpu_id, logical_cpu; 298 int cpu_id, logical_cpu;
299 299
300 logical_cpu = first_cpu(avail); 300 logical_cpu = cpumask_first(&avail);
301 if (logical_cpu == NR_CPUS) 301 if (logical_cpu >= nr_cpu_ids)
302 return 0; 302 return 0;
303 for (cpu_id = 0; cpu_id <= 65535; cpu_id++) { 303 for (cpu_id = 0; cpu_id <= 65535; cpu_id++) {
304 if (cpu_known(cpu_id)) 304 if (cpu_known(cpu_id))
@@ -309,8 +309,8 @@ static int smp_rescan_cpus_sigp(cpumask_t avail)
309 continue; 309 continue;
310 cpu_set(logical_cpu, cpu_present_map); 310 cpu_set(logical_cpu, cpu_present_map);
311 smp_cpu_state[logical_cpu] = CPU_STATE_CONFIGURED; 311 smp_cpu_state[logical_cpu] = CPU_STATE_CONFIGURED;
312 logical_cpu = next_cpu(logical_cpu, avail); 312 logical_cpu = cpumask_next(logical_cpu, &avail);
313 if (logical_cpu == NR_CPUS) 313 if (logical_cpu >= nr_cpu_ids)
314 break; 314 break;
315 } 315 }
316 return 0; 316 return 0;
@@ -322,8 +322,8 @@ static int smp_rescan_cpus_sclp(cpumask_t avail)
322 int cpu_id, logical_cpu, cpu; 322 int cpu_id, logical_cpu, cpu;
323 int rc; 323 int rc;
324 324
325 logical_cpu = first_cpu(avail); 325 logical_cpu = cpumask_first(&avail);
326 if (logical_cpu == NR_CPUS) 326 if (logical_cpu >= nr_cpu_ids)
327 return 0; 327 return 0;
328 info = kmalloc(sizeof(*info), GFP_KERNEL); 328 info = kmalloc(sizeof(*info), GFP_KERNEL);
329 if (!info) 329 if (!info)
@@ -344,8 +344,8 @@ static int smp_rescan_cpus_sclp(cpumask_t avail)
344 smp_cpu_state[logical_cpu] = CPU_STATE_STANDBY; 344 smp_cpu_state[logical_cpu] = CPU_STATE_STANDBY;
345 else 345 else
346 smp_cpu_state[logical_cpu] = CPU_STATE_CONFIGURED; 346 smp_cpu_state[logical_cpu] = CPU_STATE_CONFIGURED;
347 logical_cpu = next_cpu(logical_cpu, avail); 347 logical_cpu = cpumask_next(logical_cpu, &avail);
348 if (logical_cpu == NR_CPUS) 348 if (logical_cpu >= nr_cpu_ids)
349 break; 349 break;
350 } 350 }
351out: 351out:
@@ -591,7 +591,7 @@ static int __init setup_possible_cpus(char *s)
591 591
592 pcpus = simple_strtoul(s, NULL, 0); 592 pcpus = simple_strtoul(s, NULL, 0);
593 cpu_possible_map = cpumask_of_cpu(0); 593 cpu_possible_map = cpumask_of_cpu(0);
594 for (cpu = 1; cpu < pcpus && cpu < NR_CPUS; cpu++) 594 for (cpu = 1; cpu < pcpus && cpu < nr_cpu_ids; cpu++)
595 cpu_set(cpu, cpu_possible_map); 595 cpu_set(cpu, cpu_possible_map);
596 return 0; 596 return 0;
597} 597}