Skip to content

Commit 53fc190

Browse files
committed
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 <[email protected]>
1 parent b9be19e commit 53fc190

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

kernel/smp.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,9 +1088,11 @@ static int __init maxcpus(char *str)
10881088

10891089
early_param("maxcpus", maxcpus);
10901090

1091+
#if (NR_CPUS > 1)
10911092
/* Setup number of possible processor ids */
10921093
unsigned int nr_cpu_ids __read_mostly = NR_CPUS;
10931094
EXPORT_SYMBOL(nr_cpu_ids);
1095+
#endif
10941096

10951097
/* An arch may set nr_cpu_ids earlier if needed, so this would be redundant */
10961098
void __init setup_nr_cpu_ids(void)

0 commit comments

Comments
 (0)