diff mbox series

[v2] powerpc: topology.h: fix build when CONFIG_NUMA=n

Message ID 20201105223040.3612663-1-cheloha@linux.ibm.com (mailing list archive)
State Accepted
Commit 3fb4a8fa28b740709bdd3229b80279957f4d37ed
Headers show
Series [v2] powerpc: topology.h: fix build when CONFIG_NUMA=n | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success Successfully applied on branch powerpc/merge (58b9041431fcf9f3f87c8def87ca82dd54cf80dd)
snowpatch_ozlabs/build-ppc64le success Build succeeded
snowpatch_ozlabs/build-ppc64be success Build succeeded
snowpatch_ozlabs/build-ppc64e success Build succeeded
snowpatch_ozlabs/build-pmac32 success Build succeeded
snowpatch_ozlabs/checkpatch success total: 0 errors, 0 warnings, 0 checks, 31 lines checked
snowpatch_ozlabs/needsstable success Patch fixes a commit that hasn't been released yet

Commit Message

Scott Cheloha Nov. 5, 2020, 10:30 p.m. UTC
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.

Signed-off-by: Scott Cheloha <cheloha@linux.ibm.com>
Reported-by: kernel test robot <lkp@intel.com>
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(-)

Comments

Christophe Leroy Nov. 6, 2020, 6:58 a.m. UTC | #1
Le 05/11/2020 à 23:30, Scott Cheloha a écrit :
> 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.
> 
> Signed-off-by: Scott Cheloha <cheloha@linux.ibm.com>
> Reported-by: kernel test robot <lkp@intel.com>
> Fixes: 72cdd117c449 ("pseries/hotplug-memory: hot-add: skip redundant LMB lookup")

Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>

> ---
> v1: Initial patch.
> 
> v2: Incorporate suggested cleanups from Christophe Leroy.
> 
>   arch/powerpc/include/asm/topology.h | 12 +++++++++---
>   1 file changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topology.h
> index 8728590f514a..3beeb030cd78 100644
> --- a/arch/powerpc/include/asm/topology.h
> +++ b/arch/powerpc/include/asm/topology.h
> @@ -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);
>
Michael Ellerman Nov. 8, 2020, 10:29 a.m. UTC | #2
On Thu, 5 Nov 2020 16:30:40 -0600, Scott Cheloha wrote:
> 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.

Applied to powerpc/fixes.

[1/1] powerpc/numa: Fix build when CONFIG_NUMA=n
      https://git.kernel.org/powerpc/c/3fb4a8fa28b740709bdd3229b80279957f4d37ed

cheers
diff mbox series

Patch

diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topology.h
index 8728590f514a..3beeb030cd78 100644
--- a/arch/powerpc/include/asm/topology.h
+++ b/arch/powerpc/include/asm/topology.h
@@ -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);