Skip to content

Commit

Permalink
cpumask: Use find_last_bit()
Browse files Browse the repository at this point in the history
Impact: cleanup

There's one obvious place to use it: to find the highest possible cpu.

Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell committed Dec 31, 2008
1 parent ab53d47 commit e0c0ba7
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions init/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e0c0ba7

Please sign in to comment.