diff mbox series

[RFC,17/22] x86/topology: convert to use arch_cpu_is_hotpluggable()

Message ID E1r0JM5-00CTyD-Ri@rmk-PC.armlinux.org.uk (mailing list archive)
State RFC, archived
Headers show
Series Initial cleanups for vCPU hotplug | expand

Commit Message

Russell King (Oracle) Nov. 7, 2023, 10:30 a.m. UTC
Convert x86 to use the arch_cpu_is_hotpluggable() helper rather than
arch_register_cpu().

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
 arch/x86/kernel/topology.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

Comments

Gavin Shan Nov. 13, 2023, 4:18 a.m. UTC | #1
On 11/7/23 20:30, Russell King (Oracle) wrote:
> Convert x86 to use the arch_cpu_is_hotpluggable() helper rather than
> arch_register_cpu().
> 
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
> ---
>   arch/x86/kernel/topology.c | 7 ++-----
>   1 file changed, 2 insertions(+), 5 deletions(-)
> 
Reviewed-by: Gavin Shan <gshan@redhat.com>
Jonathan Cameron Nov. 28, 2023, 3:18 p.m. UTC | #2
On Tue, 07 Nov 2023 10:30:45 +0000
"Russell King (Oracle)" <rmk+kernel@armlinux.org.uk> wrote:

> Convert x86 to use the arch_cpu_is_hotpluggable() helper rather than
> arch_register_cpu().
> 
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

As with earlier set of related changes, could squash this down to avoid
churn and use Co-developed or similar. Up to you though.

Maybe a forwards reference to this being a later change in the patch 15
description might be good though!
> ---
>  arch/x86/kernel/topology.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/x86/kernel/topology.c b/arch/x86/kernel/topology.c
> index 211863cb5b81..d42c28b8bfd8 100644
> --- a/arch/x86/kernel/topology.c
> +++ b/arch/x86/kernel/topology.c
> @@ -36,11 +36,8 @@
>  #include <asm/cpu.h>
>  
>  #ifdef CONFIG_HOTPLUG_CPU
> -int arch_register_cpu(int cpu)
> +bool arch_cpu_is_hotpluggable(int cpu)
>  {
> -	struct cpu *c = per_cpu_ptr(&cpu_devices, cpu);
> -
> -	c->hotpluggable = cpu > 0;
> -	return register_cpu(c, cpu);
> +	return cpu > 0;
>  }
>  #endif /* CONFIG_HOTPLUG_CPU */
diff mbox series

Patch

diff --git a/arch/x86/kernel/topology.c b/arch/x86/kernel/topology.c
index 211863cb5b81..d42c28b8bfd8 100644
--- a/arch/x86/kernel/topology.c
+++ b/arch/x86/kernel/topology.c
@@ -36,11 +36,8 @@ 
 #include <asm/cpu.h>
 
 #ifdef CONFIG_HOTPLUG_CPU
-int arch_register_cpu(int cpu)
+bool arch_cpu_is_hotpluggable(int cpu)
 {
-	struct cpu *c = per_cpu_ptr(&cpu_devices, cpu);
-
-	c->hotpluggable = cpu > 0;
-	return register_cpu(c, cpu);
+	return cpu > 0;
 }
 #endif /* CONFIG_HOTPLUG_CPU */