diff options
author | Mike Travis <travis@sgi.com> | 2008-12-31 21:08:46 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-01-03 13:00:55 -0500 |
commit | 9628937d5b37169151c5f6bbd40919c6ac958a46 (patch) | |
tree | 09e49f6960806e4115b3345ccc4b5745ca784074 /arch/x86/mach-voyager | |
parent | 6ca09dfc9f180d038dcef93c167a833f43a8246f (diff) |
x86: cleanup some remaining usages of NR_CPUS where s/b nr_cpu_ids
Impact: Reduce future system panics due to cpumask operations using NR_CPUS
Insure that code does not look at bits >= nr_cpu_ids as when cpumasks are
allocated based on nr_cpu_ids, these extra bits will not be defined.
Also some other minor updates:
* change in to use cpu accessor function set_cpu_present() instead of
directly accessing cpu_present_map w/cpu_clear() [arch/x86/kernel/reboot.c]
* use cpumask_of() instead of &cpumask_of_cpu() [arch/x86/kernel/reboot.c]
* optimize some cpu_mask_to_apicid_and functions.
Signed-off-by: Mike Travis <travis@sgi.com>
Acked-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/mach-voyager')
-rw-r--r-- | arch/x86/mach-voyager/voyager_smp.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/arch/x86/mach-voyager/voyager_smp.c b/arch/x86/mach-voyager/voyager_smp.c index a5bc05492b1e..9840b7ec749a 100644 --- a/arch/x86/mach-voyager/voyager_smp.c +++ b/arch/x86/mach-voyager/voyager_smp.c | |||
@@ -357,9 +357,8 @@ void __init find_smp_config(void) | |||
357 | printk("VOYAGER SMP: Boot cpu is %d\n", boot_cpu_id); | 357 | printk("VOYAGER SMP: Boot cpu is %d\n", boot_cpu_id); |
358 | 358 | ||
359 | /* initialize the CPU structures (moved from smp_boot_cpus) */ | 359 | /* initialize the CPU structures (moved from smp_boot_cpus) */ |
360 | for (i = 0; i < NR_CPUS; i++) { | 360 | for (i = 0; i < nr_cpu_ids; i++) |
361 | cpu_irq_affinity[i] = ~0; | 361 | cpu_irq_affinity[i] = ~0; |
362 | } | ||
363 | cpu_online_map = cpumask_of_cpu(boot_cpu_id); | 362 | cpu_online_map = cpumask_of_cpu(boot_cpu_id); |
364 | 363 | ||
365 | /* The boot CPU must be extended */ | 364 | /* The boot CPU must be extended */ |
@@ -1227,7 +1226,7 @@ int setup_profiling_timer(unsigned int multiplier) | |||
1227 | * new values until the next timer interrupt in which they do process | 1226 | * new values until the next timer interrupt in which they do process |
1228 | * accounting. | 1227 | * accounting. |
1229 | */ | 1228 | */ |
1230 | for (i = 0; i < NR_CPUS; ++i) | 1229 | for (i = 0; i < nr_cpu_ids; ++i) |
1231 | per_cpu(prof_multiplier, i) = multiplier; | 1230 | per_cpu(prof_multiplier, i) = multiplier; |
1232 | 1231 | ||
1233 | return 0; | 1232 | return 0; |
@@ -1257,7 +1256,7 @@ void __init voyager_smp_intr_init(void) | |||
1257 | int i; | 1256 | int i; |
1258 | 1257 | ||
1259 | /* initialize the per cpu irq mask to all disabled */ | 1258 | /* initialize the per cpu irq mask to all disabled */ |
1260 | for (i = 0; i < NR_CPUS; i++) | 1259 | for (i = 0; i < nr_cpu_ids; i++) |
1261 | vic_irq_mask[i] = 0xFFFF; | 1260 | vic_irq_mask[i] = 0xFFFF; |
1262 | 1261 | ||
1263 | VIC_SET_GATE(VIC_CPI_LEVEL0, vic_cpi_interrupt); | 1262 | VIC_SET_GATE(VIC_CPI_LEVEL0, vic_cpi_interrupt); |