Skip to content

Commit

Permalink
smp: don't declare nr_cpu_ids if NR_CPUS == 1
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Yury Norov committed Sep 20, 2022
1 parent b9be19e commit 53fc190
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 53fc190

Please sign in to comment.