]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/powermac: Drop unnecessary of_node_put
authorJulia Lawall <julia@diku.dk>
Tue, 3 Aug 2010 09:50:32 +0000 (09:50 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 24 Aug 2010 05:26:28 +0000 (15:26 +1000)
commitb2fd0aaa30952ae3a1533bf8e9fb70e054165e5b
tree9c39eb80190cb4774959d5b1dc55ec7f28da860d
parent74b3d8b3bae8b02786c8a2819dd356ae9510b64c
powerpc/powermac: Drop unnecessary of_node_put

for_each_node_by_name only exits when its first argument is NULL, and a
subsequent call to of_node_put on that argument is unnecessary.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
iterator name for_each_node_by_name;
expression np,E;
identifier l;
@@

for_each_node_by_name(np,...) {
  ... when != break;
      when != goto l;
}
... when != np = E
- of_node_put(np);
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Reviewed-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/platforms/powermac/feature.c
arch/powerpc/platforms/powermac/pci.c