Skip to content

Commit 4c8a498

Browse files
author
Ingo Molnar
committed
smp: Avoid 'setup_max_cpus' namespace collision/shadowing
bringup_nonboot_cpus() gets passed the 'setup_max_cpus' variable in init/main.c - which is also the name of the parameter, shadowing the name. To reduce confusion and to allow the 'setup_max_cpus' value to be #defined in the <linux/smp.h> header, use the 'max_cpus' name for the function parameter name. Signed-off-by: Ingo Molnar <mingo@kernel.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-kernel@vger.kernel.org
1 parent 89b0f15 commit 4c8a498

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

include/linux/cpu.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ void notify_cpu_starting(unsigned int cpu);
112112
extern void cpu_maps_update_begin(void);
113113
extern void cpu_maps_update_done(void);
114114
int bringup_hibernate_cpu(unsigned int sleep_cpu);
115-
void bringup_nonboot_cpus(unsigned int setup_max_cpus);
115+
void bringup_nonboot_cpus(unsigned int max_cpus);
116116

117117
#else /* CONFIG_SMP */
118118
#define cpuhp_tasks_frozen 0

kernel/cpu.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1909,14 +1909,14 @@ static bool __init cpuhp_bringup_cpus_parallel(unsigned int ncpus)
19091909
static inline bool cpuhp_bringup_cpus_parallel(unsigned int ncpus) { return false; }
19101910
#endif /* CONFIG_HOTPLUG_PARALLEL */
19111911

1912-
void __init bringup_nonboot_cpus(unsigned int setup_max_cpus)
1912+
void __init bringup_nonboot_cpus(unsigned int max_cpus)
19131913
{
19141914
/* Try parallel bringup optimization if enabled */
1915-
if (cpuhp_bringup_cpus_parallel(setup_max_cpus))
1915+
if (cpuhp_bringup_cpus_parallel(max_cpus))
19161916
return;
19171917

19181918
/* Full per CPU serialized bringup */
1919-
cpuhp_bringup_mask(cpu_present_mask, setup_max_cpus, CPUHP_ONLINE);
1919+
cpuhp_bringup_mask(cpu_present_mask, max_cpus, CPUHP_ONLINE);
19201920
}
19211921

19221922
#ifdef CONFIG_PM_SLEEP_SMP

0 commit comments

Comments
 (0)