aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Jaillet <christophe.jaillet@wanadoo.fr>2015-10-11 16:23:27 -0400
committerMichael Ellerman <mpe@ellerman.id.au>2015-10-15 05:32:00 -0400
commit1def37586fb1f3bbbedeaa64bf047595958dfc66 (patch)
tree25e7ac8961c2272dc8a7a700a6dd53fbcfc51716
parent5fab1d1cb18d27d1a2a5f110e0955a1b3c497013 (diff)
powerpc/numa: Use of_get_next_parent to simplify code
of_get_next_parent can be used to simplify the while() loop and avoid the need of a temp variable. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
-rw-r--r--arch/powerpc/mm/numa.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index 8b9502adaf79..b85d44271c3b 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -276,7 +276,6 @@ static int of_node_to_nid_single(struct device_node *device)
276/* Walk the device tree upwards, looking for an associativity id */ 276/* Walk the device tree upwards, looking for an associativity id */
277int of_node_to_nid(struct device_node *device) 277int of_node_to_nid(struct device_node *device)
278{ 278{
279 struct device_node *tmp;
280 int nid = -1; 279 int nid = -1;
281 280
282 of_node_get(device); 281 of_node_get(device);
@@ -285,9 +284,7 @@ int of_node_to_nid(struct device_node *device)
285 if (nid != -1) 284 if (nid != -1)
286 break; 285 break;
287 286
288 tmp = device; 287 device = of_get_next_parent(device);
289 device = of_get_parent(tmp);
290 of_node_put(tmp);
291 } 288 }
292 of_node_put(device); 289 of_node_put(device);
293 290