Skip to content

Commit 3fb4a8f

Browse files
Scott Chelohampe
authored andcommitted
powerpc/numa: 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: 72cdd11 ("pseries/hotplug-memory: hot-add: skip redundant LMB lookup") Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Scott Cheloha <cheloha@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20201105223040.3612663-1-cheloha@linux.ibm.com
1 parent 33fe43c commit 3fb4a8f

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

arch/powerpc/include/asm/topology.h

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
struct device;
88
struct device_node;
9+
struct drmem_lmb;
910

1011
#ifdef CONFIG_NUMA
1112

@@ -61,6 +62,9 @@ static inline int early_cpu_to_node(int cpu)
6162
*/
6263
return (nid < 0) ? 0 : nid;
6364
}
65+
66+
int of_drconf_to_nid_single(struct drmem_lmb *lmb);
67+
6468
#else
6569

6670
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)
8488
return 0;
8589
}
8690

87-
#endif /* CONFIG_NUMA */
91+
static inline int of_drconf_to_nid_single(struct drmem_lmb *lmb)
92+
{
93+
return first_online_node;
94+
}
8895

89-
struct drmem_lmb;
90-
int of_drconf_to_nid_single(struct drmem_lmb *lmb);
96+
#endif /* CONFIG_NUMA */
9197

9298
#if defined(CONFIG_NUMA) && defined(CONFIG_PPC_SPLPAR)
9399
extern int find_and_online_cpu_nid(int cpu);

0 commit comments

Comments
 (0)