From: Markus Elfring <Markus.Elfring@web.de>
To: Julia Lawall <julia.lawall@inria.fr>,
Denis Efremov <efremov@linux.com>,
Coccinelle <cocci@systeme.lip6.fr>
Cc: Michal Marek <michal.lkml@markovi.net>,
Gilles Muller <Gilles.Muller@lip6.fr>,
Nicolas Palix <nicolas.palix@imag.fr>,
kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [Cocci] coccinelle: api: add kvfree script
Date: Sat, 6 Jun 2020 17:10:08 +0200 [thread overview]
Message-ID: <c0cfb9da-16a5-f37d-e98c-a57fc303fcc5@web.de> (raw)
In-Reply-To: <alpine.DEB.2.21.2006061634130.19534@hadrien>
>> * A limited search approach was expressed. Will additional source code variations
>> become relevant?
>> + switch statement
>> + if branches with single statements
>> + conditional operator
>
> The point is that there is a kmalloc in one branch and a vmalloc in
> another branch, so a if with a single branch doesn't seem relevant.
Is an other wording more appropriate to handle if/else statements
without curly brackets?
> The other cases sem highly improbable.
This can be.
But how much do such details influence the confidence level
for such a SmPL script?
>>> +@opportunity depends on !patch …@
>> …
>>> + E = \(kmalloc\|…\)(..., size, ...)
>>> + ... when != E = E1
>>> + when != size = E1
>>
>> I wonder that two assignments should be excluded here according to
>> the same expression metavariable.
>
> Doesn't matter.
Would different variable names reduce the potential for confusion?
> The metavariables are considered separately in the different whens.
Is this information relevant for a better software documentation?
>>> +@pkfree depends on patch exists@
>> …
>>> +- \(kfree\|kvfree\)(E)
>>> ++ vfree(E)
>>
>> Would you like to use a SmPL code variant like the following
>> at any more places?
>> (Is it occasionally helpful to increase the change precision?)
>>
>> +-\(kfree\|kvfree\)
>> ++vfree
>> + (E)
>
> "increase the change precision" seems to be an obscure way to say "improve
> the formatting".
We come along a different understanding of such a transformation approach
once more.
> Indeed, leaving (E) as is would have the effect of not changing the formatting.
I just propose to leave source code unmodified as much as possible here.
> But the problem seems unlikely for a functoin with such a short name.
This can be.
> And this presentation will likely run afoul of the fact
> that you can't attach + code to a disjunction.
There is a minus character before such SmPL disjunctions.
> So the original presentation was more concise, and should be fine in practice.
Is less duplicated SmPL code useful?
I point a design alternative out.
Would you like to integrate it anyhow?
Regards,
Markus
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci
next prev parent reply other threads:[~2020-06-06 15:10 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-06 14:04 [Cocci] [PATCH] coccinelle: api: add kvfree script Markus Elfring
2020-06-06 14:39 ` Julia Lawall
2020-06-06 15:10 ` Markus Elfring [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-06-14 15:10 [Cocci] " Markus Elfring
2020-06-06 7:30 [Cocci] [PATCH] " Markus Elfring
2020-06-06 7:46 ` Julia Lawall
2020-06-06 9:50 ` [Cocci] " Markus Elfring
2020-06-06 11:06 ` Markus Elfring
2020-06-06 11:11 ` Julia Lawall
2020-06-06 11:21 ` 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=c0cfb9da-16a5-f37d-e98c-a57fc303fcc5@web.de \
--to=markus.elfring@web.de \
--cc=Gilles.Muller@lip6.fr \
--cc=cocci@systeme.lip6.fr \
--cc=efremov@linux.com \
--cc=julia.lawall@inria.fr \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.lkml@markovi.net \
--cc=nicolas.palix@imag.fr \
/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).