linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: mchehab@osg.samsung.com (Mauro Carvalho Chehab)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] media: platform: exynos4-is: media-dev: Add missing of_node_put
Date: Tue, 26 Jan 2016 07:12:42 -0200	[thread overview]
Message-ID: <20160126071242.4a127d3f@recife.lan> (raw)
In-Reply-To: <alpine.DEB.2.02.1601260809340.2004@localhost6.localdomain6>

Em Tue, 26 Jan 2016 08:12:15 +0100
Julia Lawall <julia.lawall@lip6.fr> escreveu:

> On Tue, 26 Jan 2016, Krzysztof Kozlowski wrote:
> 
> > On 26.01.2016 15:24, Julia Lawall wrote:  
> > > 
> > > 
> > > On Tue, 26 Jan 2016, Krzysztof Kozlowski wrote:
> > >   
> > >> On 26.01.2016 00:21, Amitoj Kaur Chawla wrote:  
> > >>> for_each_available_child_of_node and for_each_child_of_node perform an
> > >>> of_node_get on each iteration, so to break out of the loop an of_node_put is
> > >>> required.
> > >>>
> > >>> Found using Coccinelle. The simplified version of the semantic patch
> > >>> that is used for this is as follows:
> > >>>
> > >>> // <smpl>
> > >>> @@
> > >>> local idexpression n;
> > >>> expression e,r;
> > >>> @@
> > >>>
> > >>>  for_each_available_child_of_node(r,n) {
> > >>>    ...
> > >>> (
> > >>>    of_node_put(n);
> > >>> |
> > >>>    e = n
> > >>> |
> > >>> +  of_node_put(n);
> > >>> ?  break;
> > >>> )
> > >>>    ...
> > >>>  }
> > >>> ... when != n
> > >>> // </smpl>  
> > >>
> > >> Patch iselft looks correct but why are you pasting coccinelle script
> > >> into the message?
> > >>
> > >> The script is already present in Linux kernel:
> > >> scripts/coccinelle/iterators/device_node_continue.cocci  
> > > 
> > > I don't think so.  The continue one takes care of the case where there is 
> > > an extraneous of_node_put before a continue, not a missing one before a 
> > > break.  But OK to drop it if it doesn't seem useful.
> > > 
> > > julia  
> > 
> > You are right - this is not covered by that cocci patch... but I think
> > is covered by scripts/coccinelle/iterators/fen.cocci, isn't it?  
> 
> Not quite. 

If the script is not part of the Kernel, please keep the script in the
patch, as it could be useful in some future.

Regards,
Mauro

      reply	other threads:[~2016-01-26  9:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-25 15:21 [PATCH] media: platform: exynos4-is: media-dev: Add missing of_node_put Amitoj Kaur Chawla
2016-01-26  0:24 ` Krzysztof Kozlowski
2016-01-26  6:24   ` Julia Lawall
2016-01-26  6:55     ` Krzysztof Kozlowski
2016-01-26  7:12       ` Julia Lawall
2016-01-26  9:12         ` Mauro Carvalho Chehab [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160126071242.4a127d3f@recife.lan \
    --to=mchehab@osg.samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).