From: Markus Elfring <Markus.Elfring@web.de>
To: Denis Efremov <efremov@linux.com>,
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>,
Coccinelle <cocci@systeme.lip6.fr>
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] coccinelle: api: add kzfree script
Date: Thu, 4 Jun 2020 17:20:58 +0200 [thread overview]
Message-ID: <96653281-3812-8b44-0dd8-6e7540a26a89@web.de> (raw)
> Check for memset() with 0 followed by kfree().
I suggest to simplify the SmPL code a bit like the following.
> +virtual context
> +virtual org
> +virtual report
> +virtual patch
+virtual context, org, report, patch
…
> +@@
> +
> +(
> +* memset(E, 0, ...);
> +|
> +* memset(E, '\0', ...);
> +)
> +* kfree(E)@p;
+@@
+*memset(E, 0, ...);
+*kfree(E)@p;
How does the SmPL asterisk functionality fit to the operation
modes “org” and “report”?
> +@@
> +
> +(
> +- memset(E, 0, ...);
> +|
> +- memset(E, '\0', ...);
> +)
> +- kfree(E);
> ++ kzfree(E);
+@@
+-memset(E, 0, ...);
+-kfree
++kzfree
+ (E);
I got the impression that the specification of a SmPL disjunction
could be omitted because of the technical detail that the isomorphism
“zero_multiple_format” should handle such an use case already.
Would you like to tolerate any extra source code between these function calls?
Regards,
Markus
next reply other threads:[~2020-06-04 15:21 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-04 15:20 Markus Elfring [this message]
2020-06-04 15:56 ` [PATCH] coccinelle: api: add kzfree script Julia Lawall
2020-06-04 16:08 ` Markus Elfring
-- strict thread matches above, loose matches on Subject: below --
2020-06-04 14:08 [PATCH] " Denis Efremov
2020-06-04 14:15 ` Julia Lawall
2020-06-04 15:39 ` Denis Efremov
2020-06-04 15:51 ` Julia Lawall
2020-06-04 17:22 ` Denis Efremov
2020-06-04 17:28 ` Julia Lawall
2020-06-04 16:27 ` Joe Perches
2020-06-04 17:30 ` Denis Efremov
2020-06-04 17:36 ` Joe Perches
2020-06-14 19:42 ` Denis Efremov
2020-06-14 20:01 ` Joe Perches
2020-06-15 12:03 ` Dan Carpenter
2020-06-15 13:51 ` 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=96653281-3812-8b44-0dd8-6e7540a26a89@web.de \
--to=markus.elfring@web.de \
--cc=Gilles.Muller@lip6.fr \
--cc=Julia.Lawall@lip6.fr \
--cc=cocci@systeme.lip6.fr \
--cc=efremov@linux.com \
--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).