[PATCH] pmdomain: rockchip: Simplify dropping OF node reference

Markus Elfring Markus.Elfring at web.de
Fri Sep 13 06:16:09 PDT 2024


> Drop OF node reference immediately after using it in
> syscon_node_to_regmap(), which is both simpler and typical/expected
> code pattern.

Dear Krzysztof,

I noticed also this contribution.
I found it easy to convert it also into the following small script variant
for the semantic patch language (Coccinelle software).


@adjustment@
expression e, x;
@@
+of_node_put(e);
 if (...)
 {
 <+... when != e = x
-   of_node_put(e);
 ...+>
 }
-of_node_put(e);


58 patches were accordingly generated for source files of the software “Linux next-20240913”.
How would we like to tackle remaining update candidates according to similar transformation patterns?

Regards,
Markus



More information about the Linux-rockchip mailing list