[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.21.2001051139010.2579@hadrien>
Date: Sun, 5 Jan 2020 11:41:00 +0100 (CET)
From: Julia Lawall <julia.lawall@...ia.fr>
To: Markus Elfring <Markus.Elfring@....de>
cc: Wen Yang <wenyang@...ux.alibaba.com>, cocci@...teme.lip6.fr,
kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org,
Gilles Muller <Gilles.Muller@...6.fr>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Julia Lawall <Julia.Lawall@...6.fr>,
Masahiro Yamada <yamada.masahiro@...ionext.com>,
Matthias Männich <maennich@...gle.com>,
Michal Marek <michal.lkml@...kovi.net>,
Nicolas Palix <nicolas.palix@...g.fr>,
Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH] coccinelle: semantic patch to check for inappropriate
do_div() calls
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?
>
>
> > +@...ipt: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
Powered by blists - more mailing lists