diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2009-01-01 10:12:19 +1030 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2009-01-01 10:12:19 +1030 |
commit | e0c0ba736547e81c4f986ce192307c549d214167 (patch) | |
tree | 6e602e15ca491ddb14d68d9116a1503efb618ac6 /init | |
parent | ab53d472e785e51fdfc08fc1d66252c1153e6c0f (diff) | |
download | kernel-common-e0c0ba736547e81c4f986ce192307c549d214167.tar.gz kernel-common-e0c0ba736547e81c4f986ce192307c549d214167.tar.bz2 kernel-common-e0c0ba736547e81c4f986ce192307c549d214167.zip |
cpumask: Use find_last_bit()
Impact: cleanup
There's one obvious place to use it: to find the highest possible cpu.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'init')
-rw-r--r-- | init/main.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/init/main.c b/init/main.c index 84d3732c0ce5..546ebd2f44ba 100644 --- a/init/main.c +++ b/init/main.c @@ -380,12 +380,7 @@ EXPORT_SYMBOL(nr_cpu_ids); /* An arch may set nr_cpu_ids earlier if needed, so this would be redundant */ static void __init setup_nr_cpu_ids(void) { - int cpu, highest_cpu = 0; - - for_each_possible_cpu(cpu) - highest_cpu = cpu; - - nr_cpu_ids = highest_cpu + 1; + nr_cpu_ids = find_last_bit(cpumask_bits(cpu_possible_mask),NR_CPUS) + 1; } #ifndef CONFIG_HAVE_SETUP_PER_CPU_AREA |