[PATCH] powpc:feature: of_node_put is not needed after iterator.

Subsystems: linux for power macintosh, linux for powerpc (32-bit and 64-bit), the rest

STALE2929d

3 messages, 3 authors, 2018-08-08 · open the first message on its own page

[PATCH] powpc:feature: of_node_put is not needed after iterator.

From: zhong jiang <hidden>
Date: 2018-08-04 14:36:45

for_each_node_by_name iterators only  exit normally when the loop
cursor is NULL, So there is no point to call of_node_put.

Signed-off-by: zhong jiang <redacted>
---
 arch/powerpc/platforms/powermac/feature.c | 2 --
 1 file changed, 2 deletions(-)
diff --git a/arch/powerpc/platforms/powermac/feature.c b/arch/powerpc/platforms/powermac/feature.c
index 3f82cb2..4eb8cb3 100644
--- a/arch/powerpc/platforms/powermac/feature.c
+++ b/arch/powerpc/platforms/powermac/feature.c
@@ -2889,10 +2889,8 @@ static void __init probe_one_macio(const char *name, const char *compat, int typ
 	/* On all machines, switch modem & serial ports off */
 	for_each_node_by_name(np, "ch-a")
 		initial_serial_shutdown(np);
-	of_node_put(np);
 	for_each_node_by_name(np, "ch-b")
 		initial_serial_shutdown(np);
-	of_node_put(np);
 }
 
 void __init
-- 
1.7.12.4

Re: [PATCH] powpc:feature: of_node_put is not needed after iterator.

From: Tyrel Datwyler <hidden>
Date: 2018-08-04 20:37:51

On 08/04/2018 07:25 AM, zhong jiang wrote:
for_each_node_by_name iterators only  exit normally when the loop
cursor is NULL, So there is no point to call of_node_put.

Signed-off-by: zhong jiang <redacted>
Reviewed-by: Tyrel Datwyler <redacted>
quoted hunk
---
 arch/powerpc/platforms/powermac/feature.c | 2 --
 1 file changed, 2 deletions(-)
diff --git a/arch/powerpc/platforms/powermac/feature.c b/arch/powerpc/platforms/powermac/feature.c
index 3f82cb2..4eb8cb3 100644
--- a/arch/powerpc/platforms/powermac/feature.c
+++ b/arch/powerpc/platforms/powermac/feature.c
@@ -2889,10 +2889,8 @@ static void __init probe_one_macio(const char *name, const char *compat, int typ
 	/* On all machines, switch modem & serial ports off */
 	for_each_node_by_name(np, "ch-a")
 		initial_serial_shutdown(np);
-	of_node_put(np);
 	for_each_node_by_name(np, "ch-b")
 		initial_serial_shutdown(np);
-	of_node_put(np);
 }

 void __init

Re: powpc:feature: of_node_put is not needed after iterator.

From: Michael Ellerman <hidden>
Date: 2018-08-08 14:26:54

On Sat, 2018-08-04 at 14:25:00 UTC, zhong jiang wrote:
for_each_node_by_name iterators only  exit normally when the loop
cursor is NULL, So there is no point to call of_node_put.

Signed-off-by: zhong jiang <redacted>
Reviewed-by: Tyrel Datwyler <redacted>
Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/81d7b08b3cec79a43411e7175401b3

cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help