Skip to content

Commit 575e23b

Browse files
committed
powerpc/papr_scm: Switch to numa_map_to_online_node()
Now that the core exports numa_map_to_online_node() switch to that instead of the locally coded duplicate. Cc: Benjamin Herrenschmidt <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: "Oliver O'Halloran" <[email protected]> Acked-by: Michael Ellerman <[email protected]> Reported-by: "Aneesh Kumar K.V" <[email protected]> Reviewed-by: Aneesh Kumar K.V <[email protected]> Link: https://lore.kernel.org/r/157401276263.43284.12616818803654229788.stgit@dwillia2-desk3.amr.corp.intel.com Reviewed-by: Ingo Molnar <[email protected]> Signed-off-by: Dan Williams <[email protected]> Link: https://lore.kernel.org/r/158188325830.894464.9454884523846454529.stgit@dwillia2-desk3.amr.corp.intel.com
1 parent 4fcbe96 commit 575e23b

File tree

1 file changed

+1
-20
lines changed

1 file changed

+1
-20
lines changed

arch/powerpc/platforms/pseries/papr_scm.c

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -285,25 +285,6 @@ int papr_scm_ndctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm,
285285
return 0;
286286
}
287287

288-
static inline int papr_scm_node(int node)
289-
{
290-
int min_dist = INT_MAX, dist;
291-
int nid, min_node;
292-
293-
if ((node == NUMA_NO_NODE) || node_online(node))
294-
return node;
295-
296-
min_node = first_online_node;
297-
for_each_online_node(nid) {
298-
dist = node_distance(node, nid);
299-
if (dist < min_dist) {
300-
min_dist = dist;
301-
min_node = nid;
302-
}
303-
}
304-
return min_node;
305-
}
306-
307288
static int papr_scm_nvdimm_init(struct papr_scm_priv *p)
308289
{
309290
struct device *dev = &p->pdev->dev;
@@ -349,7 +330,7 @@ static int papr_scm_nvdimm_init(struct papr_scm_priv *p)
349330

350331
memset(&ndr_desc, 0, sizeof(ndr_desc));
351332
target_nid = dev_to_node(&p->pdev->dev);
352-
online_nid = papr_scm_node(target_nid);
333+
online_nid = numa_map_to_online_node(target_nid);
353334
ndr_desc.numa_node = online_nid;
354335
ndr_desc.target_node = target_nid;
355336
ndr_desc.res = &p->res;

0 commit comments

Comments
 (0)