Skip to content

Commit

Permalink
i2c: mpc: delete unneeded test before of_node_put
Browse files Browse the repository at this point in the history
Of_node_put supports NULL as its argument, so the initial test is not
necessary.

Suggested by Uwe Kleine-König.

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

// <smpl>
@@
expression e;
@@

-if (e)
   of_node_put(e);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
  • Loading branch information
JuliaLawall authored and Wolfram Sang committed Aug 8, 2014
1 parent 9c5f7ca commit ebba48b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/i2c/busses/i2c-mpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,7 @@ static u32 mpc_i2c_get_sec_cfg_8xxx(void)
iounmap(reg);
}
}
if (node)
of_node_put(node);
of_node_put(node);

return val;
}
Expand Down

0 comments on commit ebba48b

Please sign in to comment.