From: Christophe Jaillet Date: Sun, 11 Oct 2015 20:23:27 +0000 (+0200) Subject: powerpc/numa: Use of_get_next_parent to simplify code X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1def37586fb1f3bbbedeaa64bf047595958dfc66;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Michael Ellerman --- 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) /* Walk the device tree upwards, looking for an associativity id */ int of_node_to_nid(struct device_node *device) { - struct device_node *tmp; int nid = -1; of_node_get(device); @@ -285,9 +284,7 @@ int of_node_to_nid(struct device_node *device) if (nid != -1) break; - tmp = device; - device = of_get_parent(tmp); - of_node_put(tmp); + device = of_get_next_parent(device); } of_node_put(device);