Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc/fsl: fsl_soc: 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/)

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

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

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

authored by

Julia Lawall and committed by
Michael Ellerman
4cdd641d 0f9da5cb

+1 -2
+1 -2
arch/powerpc/sysdev/fsl_soc.c
··· 197 197 if (!rstcr && ppc_md.restart == fsl_rstcr_restart) 198 198 printk(KERN_ERR "No RSTCR register, warm reboot won't work\n"); 199 199 200 - if (np) 201 - of_node_put(np); 200 + of_node_put(np); 202 201 203 202 return 0; 204 203 }