From: Julia Lawall Date: Fri, 8 Aug 2014 10:07:42 +0000 (+0200) Subject: i2c: mpc: delete unneeded test before of_node_put X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ebba48b702ab11bbb76e357a7246bc2f19ad02bc;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git i2c: mpc: delete unneeded test before of_node_put 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/) // @@ expression e; @@ -if (e) of_node_put(e); // Signed-off-by: Julia Lawall Signed-off-by: Wolfram Sang --- diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c index 6a32aa095f83..0edf630b099a 100644 --- a/drivers/i2c/busses/i2c-mpc.c +++ b/drivers/i2c/busses/i2c-mpc.c @@ -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; }