pseries: Fix build break for SPLPAR=n and CPU hotplug

Message ID 151820002192.57762.14326361815004034389.stgit@ltcalpine2-lp14.aus.stglabs.ibm.com
State New
Headers show
Series
  • pseries: Fix build break for SPLPAR=n and CPU hotplug
Related show

Commit Message

Nathan Fontenot Feb. 9, 2018, 6:13 p.m.
Build break fix for SPLPAR=n builds and CPU hotplug.

arch/powerpc/platforms/pseries/hotplug-cpu.o: In function `.dlpar_online_cpu':
hotplug-cpu.c:(.text+0xc40): undefined reference to `.find_and_online_cpu_nid'

Move the declaration of find_and_online_cpu_nid() to topology.h where
we can define it as a no-op for SPLAPR=n builds.

Fixes: e67e02a ("powerpc/pseries: Fix cpu hotplug crash with memoryless nodes")
Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
---
 arch/powerpc/include/asm/topology.h          |    9 +++++++++
 arch/powerpc/platforms/pseries/hotplug-cpu.c |    3 +--
 2 files changed, 10 insertions(+), 2 deletions(-)

Comments

Tyrel Datwyler Feb. 9, 2018, 10:33 p.m. | #1
On 02/09/2018 10:13 AM, Nathan Fontenot wrote:
> Build break fix for SPLPAR=n builds and CPU hotplug.
> 
> arch/powerpc/platforms/pseries/hotplug-cpu.o: In function `.dlpar_online_cpu':
> hotplug-cpu.c:(.text+0xc40): undefined reference to `.find_and_online_cpu_nid'
> 
> Move the declaration of find_and_online_cpu_nid() to topology.h where
> we can define it as a no-op for SPLAPR=n builds.
> 
> Fixes: e67e02a ("powerpc/pseries: Fix cpu hotplug crash with memoryless nodes")
> Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
> ---

Reviewed-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>

Patch

diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topology.h
index 88187c285c70..4c5704a14f0d 100644
--- a/arch/powerpc/include/asm/topology.h
+++ b/arch/powerpc/include/asm/topology.h
@@ -105,6 +105,15 @@  extern int timed_topology_update(int nsecs);
 #endif /* CONFIG_PPC_SPLPAR */
 #endif /* CONFIG_HOTPLUG_CPU || CONFIG_NEED_MULTIPLE_NODES */
 
+#if defined(CONFIG_PPC_SPLPAR)
+int find_and_online_cpu_nid(int cpu);
+#else
+static inline int find_and_online_cpu_nid(int cpu)
+{
+	return 0;
+}
+#endif
+
 #include <asm-generic/topology.h>
 
 #ifdef CONFIG_SMP
diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c
index dceb51454d8d..ca6e363c2d75 100644
--- a/arch/powerpc/platforms/pseries/hotplug-cpu.c
+++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c
@@ -36,6 +36,7 @@ 
 #include <asm/xics.h>
 #include <asm/xive.h>
 #include <asm/plpar_wrappers.h>
+#include <asm/topology.h>
 
 #include "pseries.h"
 #include "offline_states.h"
@@ -340,8 +341,6 @@  static void pseries_remove_processor(struct device_node *np)
 	cpu_maps_update_done();
 }
 
-extern int find_and_online_cpu_nid(int cpu);
-
 static int dlpar_online_cpu(struct device_node *dn)
 {
 	int rc = 0;