Skip to contentSkip to conversation

powerpc: topology.h: fix build when CONFIG_NUMA=n

PATCH Applied Scott Cheloha 3 participants 3 messages Nov 5, 2020 – Nov 8, 2020 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 powerpc: topology.h: fix build when CONFIG_NUMA=n

Add a non-NUMA definition for of_drconf_to_nid_single() to topology.h so we have one even if powerpc/mm/numa.c is not compiled. On a non-NUMA kernel the appropriate node id is always first_online_node.

Fixes 72cdd117c449 ("pseries/hotplug-memory: hot-add: skip redundant LMB lookup")

---
v1: Initial patch.

v2: Incorporate suggested cleanups from Christophe Leroy.

 arch/powerpc/include/asm/topology.h | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
arch/powerpc/include/asm/topology.h +9 -3
index 8728590f514a..3beeb030cd78 100644
@@ -6,6 +6,7 @@
 
 struct device;
 struct device_node;
+struct drmem_lmb;
 
 #ifdef CONFIG_NUMA
 
@@ -61,6 +62,9 @@ static inline int early_cpu_to_node(int cpu)
 	 */
 	return (nid < 0) ? 0 : nid;
 }
+
+int of_drconf_to_nid_single(struct drmem_lmb *lmb);
+
 #else
 
 static inline int early_cpu_to_node(int cpu) { return 0; }
@@ -84,10 +88,12 @@ static inline int cpu_distance(__be32 *cpu1_assoc, __be32 *cpu2_assoc)
 	return 0;
 }
 
-#endif /* CONFIG_NUMA */
+static inline int of_drconf_to_nid_single(struct drmem_lmb *lmb)
+{
+	return first_online_node;
+}
 
-struct drmem_lmb;
-int of_drconf_to_nid_single(struct drmem_lmb *lmb);
+#endif /* CONFIG_NUMA */
 
 #if defined(CONFIG_NUMA) && defined(CONFIG_PPC_SPLPAR)
 extern int find_and_online_cpu_nid(int cpu);
Signature · 1 line
2.28.0
Reviewed-by on v2 1/1
#1 lore raw

Le 05/11/2020 à 23:30, Scott Cheloha a écrit :

Quoted 7 lines

Add a non-NUMA definition for of_drconf_to_nid_single() to topology.h so we have one even if powerpc/mm/numa.c is not compiled. On a non-NUMA kernel the appropriate node id is always first_online_node.

Fixes 72cdd117c449 ("pseries/hotplug-memory: hot-add: skip redundant LMB lookup")
Quoted 47 lines

---
v1: Initial patch.

v2: Incorporate suggested cleanups from Christophe Leroy.

  arch/powerpc/include/asm/topology.h | 12 +++++++++---
  1 file changed, 9 insertions(+), 3 deletions(-)
arch/powerpc/include/asm/topology.h +9 -3
index 8728590f514a..3beeb030cd78 100644
@@ -6,6 +6,7 @@
 
  struct device;
  struct device_node;
+struct drmem_lmb;
 
  #ifdef CONFIG_NUMA
 
@@ -61,6 +62,9 @@ static inline int early_cpu_to_node(int cpu)
  	 */
  	return (nid < 0) ? 0 : nid;
  }
+
+int of_drconf_to_nid_single(struct drmem_lmb *lmb);
+
  #else
 
  static inline int early_cpu_to_node(int cpu) { return 0; }
@@ -84,10 +88,12 @@ static inline int cpu_distance(__be32 *cpu1_assoc, __be32 *cpu2_assoc)
  	return 0;
  }
 
-#endif /* CONFIG_NUMA */
+static inline int of_drconf_to_nid_single(struct drmem_lmb *lmb)
+{
+	return first_online_node;
+}
 
-struct drmem_lmb;
-int of_drconf_to_nid_single(struct drmem_lmb *lmb);
+#endif /* CONFIG_NUMA */
 
  #if defined(CONFIG_NUMA) && defined(CONFIG_PPC_SPLPAR)
  extern int find_and_online_cpu_nid(int cpu);