From: Julia Lawall <julia.lawall@inria.fr>
To: Markus Elfring <Markus.Elfring@web.de>
Cc: "Wen Yang" <wenyang@linux.alibaba.com>,
cocci@systeme.lip6.fr, kernel-janitors@vger.kernel.org,
linux-kernel@vger.kernel.org,
"Gilles Muller" <Gilles.Muller@lip6.fr>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Julia Lawall" <Julia.Lawall@lip6.fr>,
"Masahiro Yamada" <yamada.masahiro@socionext.com>,
"Matthias Männich" <maennich@google.com>,
"Michal Marek" <michal.lkml@markovi.net>,
"Nicolas Palix" <nicolas.palix@imag.fr>,
"Thomas Gleixner" <tglx@linutronix.de>
Subject: Re: [PATCH] coccinelle: semantic patch to check for inappropriate do_div() calls
Date: Sun, 5 Jan 2020 11:41:00 +0100 (CET) [thread overview]
Message-ID: <alpine.DEB.2.21.2001051139010.2579@hadrien> (raw)
In-Reply-To: <21e9861a-5afc-fd66-cfd1-a9b5b92b230b@web.de>
[-- Attachment #1: Type: text/plain, Size: 1153 bytes --]
On Sun, 5 Jan 2020, Markus Elfring wrote:
> > +virtual context
> > +virtual org
> > +virtual report
>
> The operation mode “patch” is not supported here.
> Should the term “semantic code search” be used instead in the subject again?
Doesn't matter,
>
>
> > +@@
> > +(
> > +* do_div(f, l);
> > +|
> > +* do_div(f, ul);
> > +|
> > +* do_div(f, ul64);
> > +|
> > +* do_div(f, sl64);
> > +)
>
> I suggest to avoid the specification of duplicate SmPL code.
>
> +@@
> +*do_div(f, \( l \| ul \| ul64 \| sl64 \) );
I don't se any point to this. The code matched will be the same in both
cases. The original code is quite readable, without the ugly \( etc.
>
> Will any more case distinctions become helpful?
>
>
> > +@script:python depends on report@
> > +p << r.p;
> > +@@
> > +
> > +msg="WARNING: WARNING: do_div() does a 64-by-32 division, which may truncation the divisor to 32-bit"
> > +coccilib.report.print_report(p[0], msg)
>
> Please improve the message construction.
Please make more precise comments (I already made some suggestions, so it
doesn't matter much here, but "please improve" does not provide any
concrete guidance).
julia
next prev parent reply other threads:[~2020-01-05 10:41 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-04 6:44 [PATCH] coccinelle: semantic patch to check for inappropriate do_div() calls Wen Yang
2020-01-04 7:00 ` Julia Lawall
2020-01-04 8:49 ` Wen Yang
2020-01-04 8:55 ` Julia Lawall
2020-01-04 13:50 ` Wen Yang
2020-01-04 13:54 ` Julia Lawall
2020-01-04 7:16 ` Julia Lawall
2020-01-05 10:33 ` Markus Elfring
2020-01-05 10:41 ` Julia Lawall [this message]
2020-01-05 12:07 ` 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.2001051139010.2579@hadrien \
--to=julia.lawall@inria.fr \
--cc=Gilles.Muller@lip6.fr \
--cc=Julia.Lawall@lip6.fr \
--cc=Markus.Elfring@web.de \
--cc=cocci@systeme.lip6.fr \
--cc=gregkh@linuxfoundation.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maennich@google.com \
--cc=michal.lkml@markovi.net \
--cc=nicolas.palix@imag.fr \
--cc=tglx@linutronix.de \
--cc=wenyang@linux.alibaba.com \
--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