aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2018-02-12 17:34:08 -0500
committerMichael Ellerman <mpe@ellerman.id.au>2018-02-13 06:38:39 -0500
commit82343484a2d4c97a03bfd81303b5493c65f05c50 (patch)
tree699f063393703274bf444e301349c03152eebe74
parentfc5c2f4a55a2c258e12013cdf287cf266dbcd2a7 (diff)
powerpc/pseries: Fix build break for SPLPAR=n and CPU hotplug
Commit e67e02a544e9 ("powerpc/pseries: Fix cpu hotplug crash with memoryless nodes") adds an unconditional call to find_and_online_cpu_nid(), which is only declared if CONFIG_PPC_SPLPAR is enabled. This results in the following build error if this is not the case. arch/powerpc/platforms/pseries/hotplug-cpu.o: In function `dlpar_online_cpu': arch/powerpc/platforms/pseries/hotplug-cpu.c:369: undefined reference to `.find_and_online_cpu_nid' Follow the guideline provided by similar functions and provide a dummy function if CONFIG_PPC_SPLPAR is not enabled. This also moves the external function declaration into an include file where it should be. Fixes: e67e02a544e9 ("powerpc/pseries: Fix cpu hotplug crash with memoryless nodes") Signed-off-by: Guenter Roeck <linux@roeck-us.net> [mpe: Change subject to emphasise the build fix] Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
-rw-r--r--arch/powerpc/include/asm/topology.h5
-rw-r--r--arch/powerpc/platforms/pseries/hotplug-cpu.c2
2 files changed, 5 insertions, 2 deletions
diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topology.h
index 1c02e6900f78..593248110902 100644
--- a/arch/powerpc/include/asm/topology.h
+++ b/arch/powerpc/include/asm/topology.h
@@ -87,6 +87,7 @@ static inline int numa_update_cpu_topology(bool cpus_locked)
87extern int start_topology_update(void); 87extern int start_topology_update(void);
88extern int stop_topology_update(void); 88extern int stop_topology_update(void);
89extern int prrn_is_enabled(void); 89extern int prrn_is_enabled(void);
90extern int find_and_online_cpu_nid(int cpu);
90#else 91#else
91static inline int start_topology_update(void) 92static inline int start_topology_update(void)
92{ 93{
@@ -100,6 +101,10 @@ static inline int prrn_is_enabled(void)
100{ 101{
101 return 0; 102 return 0;
102} 103}
104static inline int find_and_online_cpu_nid(int cpu)
105{
106 return 0;
107}
103#endif /* CONFIG_NUMA && CONFIG_PPC_SPLPAR */ 108#endif /* CONFIG_NUMA && CONFIG_PPC_SPLPAR */
104 109
105#if defined(CONFIG_HOTPLUG_CPU) || defined(CONFIG_NEED_MULTIPLE_NODES) 110#if defined(CONFIG_HOTPLUG_CPU) || defined(CONFIG_NEED_MULTIPLE_NODES)
diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c
index f78fd2068d56..652d3e96b812 100644
--- a/arch/powerpc/platforms/pseries/hotplug-cpu.c
+++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c
@@ -342,8 +342,6 @@ static void pseries_remove_processor(struct device_node *np)
342 cpu_maps_update_done(); 342 cpu_maps_update_done();
343} 343}
344 344
345extern int find_and_online_cpu_nid(int cpu);
346
347static int dlpar_online_cpu(struct device_node *dn) 345static int dlpar_online_cpu(struct device_node *dn)
348{ 346{
349 int rc = 0; 347 int rc = 0;