Skip to content

Commit

Permalink
powerpc/powermac: Drop unnecessary null test
Browse files Browse the repository at this point in the history
for_each_node_by_name binds its first argument to a non-null value, and
thus any null test on the value of that argument is superfluous.

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

// <smpl>
@@
iterator I;
expression x,E;
@@

I(x,...) { <...
(
- (x != NULL) &&
  E
  ...> }
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
  • Loading branch information
Julia Lawall authored and Benjamin Herrenschmidt committed Aug 24, 2010
1 parent d1efa2a commit 5fba610
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/powerpc/platforms/powermac/feature.c
Original file line number Diff line number Diff line change
Expand Up @@ -2873,7 +2873,7 @@ set_initial_features(void)

/* Switch airport off */
for_each_node_by_name(np, "radio") {
if (np && np->parent == macio_chips[0].of_node) {
if (np->parent == macio_chips[0].of_node) {
macio_chips[0].flags |= MACIO_FLAG_AIRPORT_ON;
core99_airport_enable(np, 0, 0);
}
Expand Down

0 comments on commit 5fba610

Please sign in to comment.