* [PATCH] powerpc/numa: Use of_get_next_parent to simplify code
@ 2015-10-11 20:23 Christophe JAILLET
2015-10-15 11:10 ` Michael Ellerman
0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2015-10-11 20:23 UTC (permalink / raw)
To: benh, paulus, mpe
Cc: linuxppc-dev, linux-kernel, kernel-janitors, Christophe JAILLET
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>
---
arch/powerpc/mm/numa.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index 8b9502a..b85d442 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);
--
2.1.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: powerpc/numa: Use of_get_next_parent to simplify code
2015-10-11 20:23 [PATCH] powerpc/numa: Use of_get_next_parent to simplify code Christophe JAILLET
@ 2015-10-15 11:10 ` Michael Ellerman
0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2015-10-15 11:10 UTC (permalink / raw)
To: Christophe Jaillet, benh, paulus
Cc: kernel-janitors, Christophe JAILLET, linuxppc-dev, linux-kernel
On Sun, 2015-11-10 at 20:23:27 UTC, Christophe Jaillet wrote:
> 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>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/1def37586fb1f3bbbedeaa64
cheers
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-10-15 11:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-11 20:23 [PATCH] powerpc/numa: Use of_get_next_parent to simplify code Christophe JAILLET
2015-10-15 11:10 ` Michael Ellerman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).