1 From 4c8a49854130da0117a0fdb858551824919a2389 Mon Sep 17 00:00:00 2001
2 From: Ingo Molnar <mingo@kernel.org>
3 Date: Tue, 27 Feb 2024 09:58:15 +0100
4 Subject: [PATCH] smp: Avoid 'setup_max_cpus' namespace collision/shadowing
6 bringup_nonboot_cpus() gets passed the 'setup_max_cpus'
7 variable in init/main.c - which is also the name of the parameter,
10 To reduce confusion and to allow the 'setup_max_cpus' value
11 to be #defined in the <linux/smp.h> header, use the 'max_cpus'
12 name for the function parameter name.
14 Signed-off-by: Ingo Molnar <mingo@kernel.org>
15 Cc: Thomas Gleixner <tglx@linutronix.de>
16 Cc: linux-kernel@vger.kernel.org
18 include/linux/cpu.h | 2 +-
19 kernel/cpu.c | 6 +++---
20 2 files changed, 4 insertions(+), 4 deletions(-)
22 --- a/include/linux/cpu.h
23 +++ b/include/linux/cpu.h
24 @@ -109,7 +109,7 @@ void notify_cpu_starting(unsigned int cp
25 extern void cpu_maps_update_begin(void);
26 extern void cpu_maps_update_done(void);
27 int bringup_hibernate_cpu(unsigned int sleep_cpu);
28 -void bringup_nonboot_cpus(unsigned int setup_max_cpus);
29 +void bringup_nonboot_cpus(unsigned int max_cpus);
31 #else /* CONFIG_SMP */
32 #define cpuhp_tasks_frozen 0
35 @@ -1905,14 +1905,14 @@ static bool __init cpuhp_bringup_cpus_pa
36 static inline bool cpuhp_bringup_cpus_parallel(unsigned int ncpus) { return false; }
37 #endif /* CONFIG_HOTPLUG_PARALLEL */
39 -void __init bringup_nonboot_cpus(unsigned int setup_max_cpus)
40 +void __init bringup_nonboot_cpus(unsigned int max_cpus)
42 /* Try parallel bringup optimization if enabled */
43 - if (cpuhp_bringup_cpus_parallel(setup_max_cpus))
44 + if (cpuhp_bringup_cpus_parallel(max_cpus))
47 /* Full per CPU serialized bringup */
48 - cpuhp_bringup_mask(cpu_present_mask, setup_max_cpus, CPUHP_ONLINE);
49 + cpuhp_bringup_mask(cpu_present_mask, max_cpus, CPUHP_ONLINE);
52 #ifdef CONFIG_PM_SLEEP_SMP