]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
parisc: simplify smp_prepare_boot_cpu()
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Fri, 20 Oct 2023 14:45:30 +0000 (15:45 +0100)
committerHelge Deller <deller@gmx.de>
Mon, 30 Oct 2023 13:54:41 +0000 (14:54 +0100)
smp_prepare_boot_cpu() reads the cpuid of the first CPU, printing a
message to state which processor booted, and setting it online and
present.

This cpuid is retrieved from per_cpu(cpu_data, 0).cpuid, which is
initialised in arch/parisc/kernel/processor.c:processor_probe() thusly:

p = &per_cpu(cpu_data, cpuid);
...
p->cpuid = cpuid; /* save CPU id */

Consequently, the cpuid retrieved seems to be guaranteed to also be
zero, meaning that the message printed in this boils down to:

pr_info("SMP: bootstrap CPU ID is 0\n");

Moreover, since kernel/cpu.c::boot_cpu_init() already sets CPU 0 to
be present and online, there is no need to do this again in
smp_prepare_boot_cpu().

Remove this code, and simplify the printk().

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: Helge Deller <deller@gmx.de>
arch/parisc/kernel/smp.c

index 2019c1f04bd037af0d346f4c4e03f42c769eb16f..444154271f237040efc50360f98e6e86b8e3b0ef 100644 (file)
@@ -404,13 +404,7 @@ alive:
 
 void __init smp_prepare_boot_cpu(void)
 {
-       int bootstrap_processor = per_cpu(cpu_data, 0).cpuid;
-
-       /* Setup BSP mappings */
-       printk(KERN_INFO "SMP: bootstrap CPU ID is %d\n", bootstrap_processor);
-
-       set_cpu_online(bootstrap_processor, true);
-       set_cpu_present(bootstrap_processor, true);
+       pr_info("SMP: bootstrap CPU ID is 0\n");
 }