Skip to content

Commit c4dd854

Browse files
Russell King (Oracle)KAGA-KOKO
authored andcommitted
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: 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
1 parent 94f6f05 commit c4dd854

File tree

7 files changed

+5
-14
lines changed

7 files changed

+5
-14
lines changed

arch/ia64/include/asm/cpu.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,4 @@ DECLARE_PER_CPU(struct ia64_cpu, cpu_devices);
1515

1616
DECLARE_PER_CPU(int, cpu_state);
1717

18-
#ifdef CONFIG_HOTPLUG_CPU
19-
extern int arch_register_cpu(int num);
20-
extern void arch_unregister_cpu(int);
21-
#endif
22-
2318
#endif /* _ASM_IA64_CPU_H_ */

arch/ia64/kernel/topology.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ void __ref arch_unregister_cpu(int num)
5959
}
6060
EXPORT_SYMBOL(arch_unregister_cpu);
6161
#else
62-
static int __init arch_register_cpu(int num)
62+
int __init arch_register_cpu(int num)
6363
{
6464
return register_cpu(&sysfs_cpus[num].cpu, num);
6565
}

arch/x86/include/asm/cpu.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ struct x86_cpu {
2828
};
2929

3030
#ifdef CONFIG_HOTPLUG_CPU
31-
extern int arch_register_cpu(int num);
32-
extern void arch_unregister_cpu(int);
3331
extern void soft_restart_cpu(void);
3432
#endif
3533

arch/x86/kernel/topology.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ void arch_unregister_cpu(int num)
5454
EXPORT_SYMBOL(arch_unregister_cpu);
5555
#else /* CONFIG_HOTPLUG_CPU */
5656

57-
static int __init arch_register_cpu(int num)
57+
int __init arch_register_cpu(int num)
5858
{
5959
return register_cpu(&per_cpu(cpu_devices, num).cpu, num);
6060
}

drivers/acpi/acpi_processor.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#define pr_fmt(fmt) "ACPI: " fmt
1313

1414
#include <linux/acpi.h>
15+
#include <linux/cpu.h>
1516
#include <linux/device.h>
1617
#include <linux/dmi.h>
1718
#include <linux/kernel.h>

include/acpi/processor.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -465,9 +465,4 @@ extern int acpi_processor_ffh_lpi_probe(unsigned int cpu);
465465
extern int acpi_processor_ffh_lpi_enter(struct acpi_lpi_state *lpi);
466466
#endif
467467

468-
#ifdef CONFIG_ACPI_HOTPLUG_CPU
469-
extern int arch_register_cpu(int cpu);
470-
extern void arch_unregister_cpu(int cpu);
471-
#endif
472-
473468
#endif

include/linux/cpu.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ extern __printf(4, 5)
8080
struct device *cpu_device_create(struct device *parent, void *drvdata,
8181
const struct attribute_group **groups,
8282
const char *fmt, ...);
83+
extern int arch_register_cpu(int cpu);
84+
extern void arch_unregister_cpu(int cpu);
8385
#ifdef CONFIG_HOTPLUG_CPU
8486
extern void unregister_cpu(struct cpu *cpu);
8587
extern ssize_t arch_cpu_probe(const char *, size_t);

0 commit comments

Comments
 (0)