summaryrefslogtreecommitdiffstats
path: root/kernel/smp.c
diff options
context:
space:
mode:
authorYury Norov <yury.norov@gmail.com>2022-09-05 16:08:16 -0700
committerYury Norov <yury.norov@gmail.com>2022-09-19 17:51:53 -0700
commit53fc190cc6771c5494d782210334d4ebb50c7103 (patch)
treed2ba0184cc013f7112be283a5cd4e70c828af392 /kernel/smp.c
parentb9be19eef35587b15da0a5d887d6e04c0c6cefab (diff)
downloadlinux-53fc190cc6771c5494d782210334d4ebb50c7103.tar.gz
linux-53fc190cc6771c5494d782210334d4ebb50c7103.tar.bz2
linux-53fc190cc6771c5494d782210334d4ebb50c7103.zip
smp: don't declare nr_cpu_ids if NR_CPUS == 1
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>
Diffstat (limited to 'kernel/smp.c')
-rw-r--r--kernel/smp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/smp.c b/kernel/smp.c
index 650810a6f29b..e971c9626a1b 100644
--- a/kernel/smp.c
+++ b/kernel/smp.c
@@ -1088,9 +1088,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)