mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 8/14] ASoC: rsnd: delete unneeded test before of_node_put
@ 2014-08-08 10:07 Julia Lawall
  2014-08-13 11:14 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Julia Lawall @ 2014-08-08 10:07 UTC (permalink / raw)
  To: Liam Girdwood
  Cc: kernel-janitors, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	alsa-devel, linux-kernel, Uwe Kleine-König

From: Julia Lawall <Julia.Lawall@lip6.fr>

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>

---
 sound/soc/sh/rcar/core.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
index 19f7896..1922ec5 100644
--- a/sound/soc/sh/rcar/core.c
+++ b/sound/soc/sh/rcar/core.c
@@ -798,10 +798,8 @@ if (name##_node) {							\
 			mod_parse(src);
 			mod_parse(dvc);
 
-			if (playback)
-				of_node_put(playback);
-			if (capture)
-				of_node_put(capture);
+			of_node_put(playback);
+			of_node_put(capture);
 		}
 
 		dai_i++;


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 8/14] ASoC: rsnd: delete unneeded test before of_node_put
  2014-08-08 10:07 [PATCH 8/14] ASoC: rsnd: delete unneeded test before of_node_put Julia Lawall
@ 2014-08-13 11:14 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2014-08-13 11:14 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Liam Girdwood, kernel-janitors, Jaroslav Kysela, Takashi Iwai,
	alsa-devel, linux-kernel, Uwe Kleine-König

[-- Attachment #1: Type: text/plain, Size: 219 bytes --]

On Fri, Aug 08, 2014 at 12:07:49PM +0200, Julia Lawall wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> Of_node_put supports NULL as its argument, so the initial test is not
> necessary.

Applied, thanks.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-08-13 11:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-08 10:07 [PATCH 8/14] ASoC: rsnd: delete unneeded test before of_node_put Julia Lawall
2014-08-13 11:14 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®