projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cpumask: Use find_last_bit()
[firefly-linux-kernel-4.4.55.git]
/
init
/
main.c
diff --git
a/init/main.c
b/init/main.c
index 84d3732c0ce50ee435447a24f48d5e85e3072850..546ebd2f44ba3acf15daedfb4f7b4a935a8e474b 100644
(file)
--- 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)
{
/* 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
}
#ifndef CONFIG_HAVE_SETUP_PER_CPU_AREA