diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2009-03-15 23:42:42 -0400 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2009-03-15 23:42:42 -0400 |
commit | 5dd3c9949a3e92ea7fd8c75d888031f7aff1f1d0 (patch) | |
tree | 18e60117e1e547fe1e973e67a43754a3d8538104 /arch/ia64/kernel | |
parent | 40fe697a1759b85f5e06c490599f4f7b03de3be7 (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/kernel')
-rw-r--r-- | arch/ia64/kernel/acpi.c | 6 | ||||
-rw-r--r-- | arch/ia64/kernel/mca.c | 6 | ||||
-rw-r--r-- | arch/ia64/kernel/perfmon.c | 4 | ||||
-rw-r--r-- | arch/ia64/kernel/salinfo.c | 6 | ||||
-rw-r--r-- | arch/ia64/kernel/setup.c | 4 |
5 files changed, 13 insertions, 13 deletions
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c index d541671caf4a..c4f41aca107f 100644 --- a/arch/ia64/kernel/acpi.c +++ b/arch/ia64/kernel/acpi.c | |||
@@ -924,9 +924,9 @@ int acpi_map_lsapic(acpi_handle handle, int *pcpu) | |||
924 | buffer.length = ACPI_ALLOCATE_BUFFER; | 924 | buffer.length = ACPI_ALLOCATE_BUFFER; |
925 | buffer.pointer = NULL; | 925 | buffer.pointer = NULL; |
926 | 926 | ||
927 | cpus_complement(tmp_map, cpu_present_map); | 927 | cpumask_complement(&tmp_map, cpu_present_mask); |
928 | cpu = first_cpu(tmp_map); | 928 | cpu = cpumask_first(&tmp_map); |
929 | if (cpu >= NR_CPUS) | 929 | if (cpu >= nr_cpu_ids) |
930 | return -EINVAL; | 930 | return -EINVAL; |
931 | 931 | ||
932 | acpi_map_cpu2node(handle, cpu, physid); | 932 | acpi_map_cpu2node(handle, cpu, physid); |
diff --git a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c index bab1de2d2f6a..8f33a8840422 100644 --- a/arch/ia64/kernel/mca.c +++ b/arch/ia64/kernel/mca.c | |||
@@ -1456,9 +1456,9 @@ ia64_mca_cmc_int_caller(int cmc_irq, void *arg) | |||
1456 | 1456 | ||
1457 | ia64_mca_cmc_int_handler(cmc_irq, arg); | 1457 | ia64_mca_cmc_int_handler(cmc_irq, arg); |
1458 | 1458 | ||
1459 | for (++cpuid ; cpuid < NR_CPUS && !cpu_online(cpuid) ; cpuid++); | 1459 | cpuid = cpumask_next(cpuid+1, cpu_online_mask); |
1460 | 1460 | ||
1461 | if (cpuid < NR_CPUS) { | 1461 | if (cpuid < nr_cpu_ids) { |
1462 | platform_send_ipi(cpuid, IA64_CMCP_VECTOR, IA64_IPI_DM_INT, 0); | 1462 | platform_send_ipi(cpuid, IA64_CMCP_VECTOR, IA64_IPI_DM_INT, 0); |
1463 | } else { | 1463 | } else { |
1464 | /* If no log record, switch out of polling mode */ | 1464 | /* If no log record, switch out of polling mode */ |
@@ -1525,7 +1525,7 @@ ia64_mca_cpe_int_caller(int cpe_irq, void *arg) | |||
1525 | 1525 | ||
1526 | ia64_mca_cpe_int_handler(cpe_irq, arg); | 1526 | ia64_mca_cpe_int_handler(cpe_irq, arg); |
1527 | 1527 | ||
1528 | for (++cpuid ; cpuid < NR_CPUS && !cpu_online(cpuid) ; cpuid++); | 1528 | cpuid = cpumask_next(cpuid+1, cpu_online_mask); |
1529 | 1529 | ||
1530 | if (cpuid < NR_CPUS) { | 1530 | if (cpuid < NR_CPUS) { |
1531 | platform_send_ipi(cpuid, IA64_CPEP_VECTOR, IA64_IPI_DM_INT, 0); | 1531 | platform_send_ipi(cpuid, IA64_CPEP_VECTOR, IA64_IPI_DM_INT, 0); |
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c index 0e499757309b..6fc1e638f0eb 100644 --- a/arch/ia64/kernel/perfmon.c +++ b/arch/ia64/kernel/perfmon.c | |||
@@ -5603,7 +5603,7 @@ pfm_interrupt_handler(int irq, void *arg) | |||
5603 | * /proc/perfmon interface, for debug only | 5603 | * /proc/perfmon interface, for debug only |
5604 | */ | 5604 | */ |
5605 | 5605 | ||
5606 | #define PFM_PROC_SHOW_HEADER ((void *)NR_CPUS+1) | 5606 | #define PFM_PROC_SHOW_HEADER ((void *)nr_cpu_ids+1) |
5607 | 5607 | ||
5608 | static void * | 5608 | static void * |
5609 | pfm_proc_start(struct seq_file *m, loff_t *pos) | 5609 | pfm_proc_start(struct seq_file *m, loff_t *pos) |
@@ -5612,7 +5612,7 @@ pfm_proc_start(struct seq_file *m, loff_t *pos) | |||
5612 | return PFM_PROC_SHOW_HEADER; | 5612 | return PFM_PROC_SHOW_HEADER; |
5613 | } | 5613 | } |
5614 | 5614 | ||
5615 | while (*pos <= NR_CPUS) { | 5615 | while (*pos <= nr_cpu_ids) { |
5616 | if (cpu_online(*pos - 1)) { | 5616 | if (cpu_online(*pos - 1)) { |
5617 | return (void *)*pos; | 5617 | return (void *)*pos; |
5618 | } | 5618 | } |
diff --git a/arch/ia64/kernel/salinfo.c b/arch/ia64/kernel/salinfo.c index ecb9eb78d687..7053c55b7649 100644 --- a/arch/ia64/kernel/salinfo.c +++ b/arch/ia64/kernel/salinfo.c | |||
@@ -317,7 +317,7 @@ retry: | |||
317 | } | 317 | } |
318 | 318 | ||
319 | n = data->cpu_check; | 319 | n = data->cpu_check; |
320 | for (i = 0; i < NR_CPUS; i++) { | 320 | for (i = 0; i < nr_cpu_ids; i++) { |
321 | if (cpu_isset(n, data->cpu_event)) { | 321 | if (cpu_isset(n, data->cpu_event)) { |
322 | if (!cpu_online(n)) { | 322 | if (!cpu_online(n)) { |
323 | cpu_clear(n, data->cpu_event); | 323 | cpu_clear(n, data->cpu_event); |
@@ -326,7 +326,7 @@ retry: | |||
326 | cpu = n; | 326 | cpu = n; |
327 | break; | 327 | break; |
328 | } | 328 | } |
329 | if (++n == NR_CPUS) | 329 | if (++n == nr_cpu_ids) |
330 | n = 0; | 330 | n = 0; |
331 | } | 331 | } |
332 | 332 | ||
@@ -337,7 +337,7 @@ retry: | |||
337 | 337 | ||
338 | /* for next read, start checking at next CPU */ | 338 | /* for next read, start checking at next CPU */ |
339 | data->cpu_check = cpu; | 339 | data->cpu_check = cpu; |
340 | if (++data->cpu_check == NR_CPUS) | 340 | if (++data->cpu_check == nr_cpu_ids) |
341 | data->cpu_check = 0; | 341 | data->cpu_check = 0; |
342 | 342 | ||
343 | snprintf(cmd, sizeof(cmd), "read %d\n", cpu); | 343 | snprintf(cmd, sizeof(cmd), "read %d\n", cpu); |
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c index 865af27c7737..ae9ec3dc76b8 100644 --- a/arch/ia64/kernel/setup.c +++ b/arch/ia64/kernel/setup.c | |||
@@ -730,10 +730,10 @@ static void * | |||
730 | c_start (struct seq_file *m, loff_t *pos) | 730 | c_start (struct seq_file *m, loff_t *pos) |
731 | { | 731 | { |
732 | #ifdef CONFIG_SMP | 732 | #ifdef CONFIG_SMP |
733 | while (*pos < NR_CPUS && !cpu_isset(*pos, cpu_online_map)) | 733 | while (*pos < nr_cpu_ids && !cpu_online(*pos)) |
734 | ++*pos; | 734 | ++*pos; |
735 | #endif | 735 | #endif |
736 | return *pos < NR_CPUS ? cpu_data(*pos) : NULL; | 736 | return *pos < nr_cpu_ids ? cpu_data(*pos) : NULL; |
737 | } | 737 | } |
738 | 738 | ||
739 | static void * | 739 | static void * |