Commit c4dd854f authored by Russell King (Oracle)'s avatar Russell King (Oracle) Committed by Thomas Gleixner

cpu-hotplug: Provide prototypes for arch CPU registration

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: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/E1qkoRr-0088Q8-Da@rmk-PC.armlinux.org.uk
parent 94f6f055
...@@ -15,9 +15,4 @@ DECLARE_PER_CPU(struct ia64_cpu, cpu_devices); ...@@ -15,9 +15,4 @@ DECLARE_PER_CPU(struct ia64_cpu, cpu_devices);
DECLARE_PER_CPU(int, cpu_state); 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_ */ #endif /* _ASM_IA64_CPU_H_ */
...@@ -59,7 +59,7 @@ void __ref arch_unregister_cpu(int num) ...@@ -59,7 +59,7 @@ void __ref arch_unregister_cpu(int num)
} }
EXPORT_SYMBOL(arch_unregister_cpu); EXPORT_SYMBOL(arch_unregister_cpu);
#else #else
static int __init arch_register_cpu(int num) int __init arch_register_cpu(int num)
{ {
return register_cpu(&sysfs_cpus[num].cpu, num); return register_cpu(&sysfs_cpus[num].cpu, num);
} }
......
...@@ -28,8 +28,6 @@ struct x86_cpu { ...@@ -28,8 +28,6 @@ struct x86_cpu {
}; };
#ifdef CONFIG_HOTPLUG_CPU #ifdef CONFIG_HOTPLUG_CPU
extern int arch_register_cpu(int num);
extern void arch_unregister_cpu(int);
extern void soft_restart_cpu(void); extern void soft_restart_cpu(void);
#endif #endif
......
...@@ -54,7 +54,7 @@ void arch_unregister_cpu(int num) ...@@ -54,7 +54,7 @@ void arch_unregister_cpu(int num)
EXPORT_SYMBOL(arch_unregister_cpu); EXPORT_SYMBOL(arch_unregister_cpu);
#else /* CONFIG_HOTPLUG_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); return register_cpu(&per_cpu(cpu_devices, num).cpu, num);
} }
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#define pr_fmt(fmt) "ACPI: " fmt #define pr_fmt(fmt) "ACPI: " fmt
#include <linux/acpi.h> #include <linux/acpi.h>
#include <linux/cpu.h>
#include <linux/device.h> #include <linux/device.h>
#include <linux/dmi.h> #include <linux/dmi.h>
#include <linux/kernel.h> #include <linux/kernel.h>
......
...@@ -465,9 +465,4 @@ extern int acpi_processor_ffh_lpi_probe(unsigned int cpu); ...@@ -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); extern int acpi_processor_ffh_lpi_enter(struct acpi_lpi_state *lpi);
#endif #endif
#ifdef CONFIG_ACPI_HOTPLUG_CPU
extern int arch_register_cpu(int cpu);
extern void arch_unregister_cpu(int cpu);
#endif
#endif #endif
...@@ -80,6 +80,8 @@ extern __printf(4, 5) ...@@ -80,6 +80,8 @@ extern __printf(4, 5)
struct device *cpu_device_create(struct device *parent, void *drvdata, struct device *cpu_device_create(struct device *parent, void *drvdata,
const struct attribute_group **groups, const struct attribute_group **groups,
const char *fmt, ...); const char *fmt, ...);
extern int arch_register_cpu(int cpu);
extern void arch_unregister_cpu(int cpu);
#ifdef CONFIG_HOTPLUG_CPU #ifdef CONFIG_HOTPLUG_CPU
extern void unregister_cpu(struct cpu *cpu); extern void unregister_cpu(struct cpu *cpu);
extern ssize_t arch_cpu_probe(const char *, size_t); extern ssize_t arch_cpu_probe(const char *, size_t);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment