From: Yury Norov yury.norov@gmail.com
mainline inclusion from mainline-v6.1-rc1 commit 53fc190cc6771c5494d782210334d4ebb50c7103 category: cleanup bugzilla: https://gitee.com/openeuler/kernel/issues/I8KQBZ CVE: NA
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?i...
--------------------------------
SMP and NR_CPUS are independent options, hence nr_cpu_ids may be declared even if NR_CPUS == 1, which is useless.
Signed-off-by: Yury Norov yury.norov@gmail.com Signed-off-by: Zheng Zucheng zhengzucheng@huawei.com --- kernel/smp.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/kernel/smp.c b/kernel/smp.c index 2023c022ad5f..bd8d63de3132 100644 --- a/kernel/smp.c +++ b/kernel/smp.c @@ -852,9 +852,11 @@ static int __init maxcpus(char *str)
early_param("maxcpus", maxcpus);
+#if (NR_CPUS > 1) /* 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)