From: Julia Lawall <julia.lawall@lip6.fr>
To: Markus Elfring <Markus.Elfring@web.de>
Cc: Wen Yang <wen.yang99@zte.com.cn>,
Gilles Muller <Gilles.Muller@lip6.fr>,
Masahiro Yamada <yamada.masahiro@socionext.com>,
Michal Marek <michal.lkml@markovi.net>,
Nicolas Palix <nicolas.palix@imag.fr>,
Wen Yang <yellowriver2010@hotmail.com>,
Xue Zhihong <xue.zhihong@zte.com.cn>,
Yi Wang <wang.yi59@zte.com.cn>,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
Coccinelle <cocci@systeme.lip6.fr>
Subject: Re: [PATCH v3] Coccinelle: semantic patch for missing put_device()
Date: Wed, 13 Feb 2019 20:52:21 +0100 (CET) [thread overview]
Message-ID: <alpine.DEB.2.21.1902132050200.2655@hadrien> (raw)
In-Reply-To: <c10e0bf1-4830-7ee4-5b21-70b521dd6c36@web.de>
On Wed, 13 Feb 2019, Markus Elfring wrote:
> > The of_find_device_by_node() takes a reference to the underlying device
> > structure, we should release that reference.
>
> I have got another concern for further software development considerations.
>
> How do you think about to describe here if it can be determined
> by source code analysis that the desired release should be performed
> only in the same function implementation (or not)?
>
> How much does this aspect influence the source code search confidence?
>
>
> > + when != e1 = (T)id
> > + when != e2 = &id->dev
> > + when != e3 = get_device(&id->dev)
> > + when != e4 = (T1)platform_get_drvdata(id)
>
> I have got another idea for a bit of software fine-tuning at such a place.
> I am unsure if it can become relevant to reduce the number of metavariables
> here by introducing a SmPL disjunction.
>
> + when != ex = \( (T)id \| &id->dev \| get_device(&id->dev) \| (T1)platform_get_drvdata(id) \)
There is no need for the disjunction. There is also no need for the
different variables. Different variables are only needed when the when
conditions are on different ...s
julia
>
>
> Regards,
> Markus
>
next prev parent reply other threads:[~2019-02-13 19:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-13 6:23 [PATCH v3] coccinelle: semantic patch for missing put_device() Wen Yang
2019-02-13 15:40 ` Markus Elfring
2019-02-13 18:29 ` [PATCH v3] Coccinelle: " Markus Elfring
2019-02-13 19:52 ` Julia Lawall [this message]
2019-02-14 8:13 ` [v3] " Markus Elfring
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=alpine.DEB.2.21.1902132050200.2655@hadrien \
--to=julia.lawall@lip6.fr \
--cc=Gilles.Muller@lip6.fr \
--cc=Markus.Elfring@web.de \
--cc=cocci@systeme.lip6.fr \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.lkml@markovi.net \
--cc=nicolas.palix@imag.fr \
--cc=wang.yi59@zte.com.cn \
--cc=wen.yang99@zte.com.cn \
--cc=xue.zhihong@zte.com.cn \
--cc=yamada.masahiro@socionext.com \
--cc=yellowriver2010@hotmail.com \
/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).