cpu-hotplug: Provide prototypes for arch CPU registration
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Mon, 25 Sep 2023 16:28:39 +0000 (17:28 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Wed, 11 Oct 2023 12:27:37 +0000 (14:27 +0200)
Provide common prototypes for arch_register_cpu() and
arch_unregister_cpu(). These are called by acpi_processor.c, with weak
versions, so the prototype for this is already set. It is generally not
necessary for function prototypes to be conditional on preprocessor macros.

Some architectures (e.g. Loongarch) are missing the prototype for this, and
rather than add it to Loongarch's asm/cpu.h, do the job once for everyone.

Since this covers everyone, remove the now unnecessary prototypes in
asm/cpu.h, and therefore remove the 'static' from one of ia64's
arch_register_cpu() definitions.

[ tglx: Bring back the ia64 part and remove the ACPI prototypes ]

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/E1qkoRr-0088Q8-Da@rmk-PC.armlinux.org.uk
arch/ia64/include/asm/cpu.h
arch/ia64/kernel/topology.c
arch/x86/include/asm/cpu.h
arch/x86/kernel/topology.c
drivers/acpi/acpi_processor.c
include/acpi/processor.h
include/linux/cpu.h

index db125df9e08882284a6454c598d1823067dd0d38..642d71675ddb29de67beb7014520326fe378b51c 100644 (file)
@@ -15,9 +15,4 @@ DECLARE_PER_CPU(struct ia64_cpu, cpu_devices);
 
 DECLARE_PER_CPU(int, cpu_state);
 
-#ifdef CONFIG_HOTPLUG_CPU
-extern int arch_register_cpu(int num);
-extern void arch_unregister_cpu(int);
-#endif
-
 #endif /* _ASM_IA64_CPU_H_ */
index 94a848b06f15a964c0a07575533d6ace844b7b0b..741863a187a661b8468fabbae5eb189c99b61c10 100644 (file)
@@ -59,7 +59,7 @@ void __ref arch_unregister_cpu(int num)
 }
 EXPORT_SYMBOL(arch_unregister_cpu);
 #else
-static int __init arch_register_cpu(int num)
+int __init arch_register_cpu(int num)
 {
        return register_cpu(&sysfs_cpus[num].cpu, num);
 }
index 3a233ebff7129c2cf8363527722cef099d5e8550..25050d953eee02d71cb50f585f2f7dcc7482c011 100644 (file)
@@ -28,8 +28,6 @@ struct x86_cpu {
 };
 
 #ifdef CONFIG_HOTPLUG_CPU
-extern int arch_register_cpu(int num);
-extern void arch_unregister_cpu(int);
 extern void soft_restart_cpu(void);
 #endif
 
index ca004e2e44699ee922998e4c51d891bd391feacb..0bab0313003362ef7549bb820bb8c2b6b59259f9 100644 (file)
@@ -54,7 +54,7 @@ void arch_unregister_cpu(int num)
 EXPORT_SYMBOL(arch_unregister_cpu);
 #else /* CONFIG_HOTPLUG_CPU */
 
-static int __init arch_register_cpu(int num)
+int __init arch_register_cpu(int num)
 {
        return register_cpu(&per_cpu(cpu_devices, num).cpu, num);
 }
index c711db8a9c332843bc84482051d4d89ef977cd00..0f5218e361df5c2d8e05d9a5e6d7fa205c1e6376 100644 (file)
@@ -12,6 +12,7 @@
 #define pr_fmt(fmt) "ACPI: " fmt
 
 #include <linux/acpi.h>
+#include <linux/cpu.h>
 #include <linux/device.h>
 #include <linux/dmi.h>
 #include <linux/kernel.h>
index 94181fe9780a5e899fe977226f5938a9ef8de470..3f34ebb275253e281fbecaad602a0531b1e6e55d 100644 (file)
@@ -465,9 +465,4 @@ extern int acpi_processor_ffh_lpi_probe(unsigned int cpu);
 extern int acpi_processor_ffh_lpi_enter(struct acpi_lpi_state *lpi);
 #endif
 
-#ifdef CONFIG_ACPI_HOTPLUG_CPU
-extern int arch_register_cpu(int cpu);
-extern void arch_unregister_cpu(int cpu);
-#endif
-
 #endif
index 0abd60a7987b6803db3e02c5571cf4a2f6c94b88..eb768a866fe31ea47449da87bcc5c8992a062d4f 100644 (file)
@@ -80,6 +80,8 @@ extern __printf(4, 5)
 struct device *cpu_device_create(struct device *parent, void *drvdata,
                                 const struct attribute_group **groups,
                                 const char *fmt, ...);
+extern int arch_register_cpu(int cpu);
+extern void arch_unregister_cpu(int cpu);
 #ifdef CONFIG_HOTPLUG_CPU
 extern void unregister_cpu(struct cpu *cpu);
 extern ssize_t arch_cpu_probe(const char *, size_t);