From: Markus Elfring <Markus.Elfring@web.de>
To: Denis Efremov <efremov@linux.com>,
Coccinelle <cocci@systeme.lip6.fr>,
Gilles Muller <Gilles.Muller@lip6.fr>,
Julia Lawall <julia.lawall@lip6.fr>,
Masahiro Yamada <yamada.masahiro@socionext.com>,
Michal Marek <michal.lkml@markovi.net>,
Nicolas Palix <nicolas.palix@imag.fr>
Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] coccinelle: api: add kvfree script
Date: Sat, 6 Jun 2020 16:04:48 +0200 [thread overview]
Message-ID: <119d91fd-1ad0-8842-10eb-ee8fa16da1b0@web.de> (raw)
> +@choice@
> +expression E, E1;
> +position kok, vok;
> +@@
> +
> +(
> + if (...) {
> + ...
> + E = \(kmalloc@kok\|…\)(...)
Further implementation details from this SmPL script caught my software
development attention.
* Is there a need to add the specification “when any” to the SmPL ellipses
before such assignment statements?
* A limited search approach was expressed. Will additional source code variations
become relevant?
+ switch statement
+ if branches with single statements
+ conditional operator
> +@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.
+@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)
Regards,
Markus
next reply other threads:[~2020-06-06 14:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-06 14:04 Markus Elfring [this message]
2020-06-06 14:39 ` [PATCH] coccinelle: api: add kvfree script Julia Lawall
2020-06-06 15:10 ` Markus Elfring
-- strict thread matches above, loose matches on Subject: below --
2020-06-06 7:30 [PATCH] " Markus Elfring
2020-06-06 7:46 ` Julia Lawall
2020-06-05 20:42 Denis Efremov
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=119d91fd-1ad0-8842-10eb-ee8fa16da1b0@web.de \
--to=markus.elfring@web.de \
--cc=Gilles.Muller@lip6.fr \
--cc=cocci@systeme.lip6.fr \
--cc=efremov@linux.com \
--cc=julia.lawall@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=yamada.masahiro@socionext.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).