Merge tag 'bitmap-6.1-rc1' of https://github.com/norov/linux
[linux-2.6-block.git] / kernel / smp.c
index e8cdc025a046fe00009072071315ddea8e8c3e9d..06a413987a14acbdcccdc6f4e29b104770f2241a 100644 (file)
@@ -1069,7 +1069,7 @@ static int __init nrcpus(char *str)
        int nr_cpus;
 
        if (get_option(&str, &nr_cpus) && nr_cpus > 0 && nr_cpus < nr_cpu_ids)
-               nr_cpu_ids = nr_cpus;
+               set_nr_cpu_ids(nr_cpus);
 
        return 0;
 }
@@ -1087,14 +1087,16 @@ static int __init maxcpus(char *str)
 
 early_param("maxcpus", maxcpus);
 
+#if (NR_CPUS > 1) && !defined(CONFIG_FORCE_NR_CPUS)
 /* Setup number of possible processor ids */
 unsigned int nr_cpu_ids __read_mostly = NR_CPUS;
 EXPORT_SYMBOL(nr_cpu_ids);
+#endif
 
 /* An arch may set nr_cpu_ids earlier if needed, so this would be redundant */
 void __init setup_nr_cpu_ids(void)
 {
-       nr_cpu_ids = find_last_bit(cpumask_bits(cpu_possible_mask),NR_CPUS) + 1;
+       set_nr_cpu_ids(find_last_bit(cpumask_bits(cpu_possible_mask), NR_CPUS) + 1);
 }
 
 /* Called by boot processor to activate the rest. */