[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a6d58a19-c49d-f72e-9576-3ca64ffd6320@linux.alibaba.com>
Date: Fri, 10 Jan 2020 21:11:08 +0800
From: Wen Yang <wenyang@...ux.alibaba.com>
To: Julia Lawall <julia.lawall@...ia.fr>
Cc: Gilles Muller <Gilles.Muller@...6.fr>,
Nicolas Palix <nicolas.palix@...g.fr>,
Michal Marek <michal.lkml@...kovi.net>,
Matthias Maennich <maennich@...gle.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Masahiro Yamada <yamada.masahiro@...ionext.com>,
Thomas Gleixner <tglx@...utronix.de>, cocci@...teme.lip6.fr,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] coccinelle: semantic patch to check for inappropriate
do_div() calls
On 2020/1/8 1:25 上午, Julia Lawall wrote:
>> +@...ends on context@
>> +expression f;
>> +long l;
>> +unsigned long ul;
>> +u64 ul64;
>> +s64 sl64;
>> +
>> +@@
>> +(
>> +* do_div(f, l);
>> +|
>> +* do_div(f, ul);
>> +|
>> +* do_div(f, ul64);
>> +|
>> +* do_div(f, sl64);
>> +)
>
> This part is not really ideal. For the reports, you filter for the
> constants, but here you don't do anything. You can put some python code
> in the matching of the metavariables:
>
> unsigned long ul : script:python() { whatever you want to check on ul };
>
> Then it will only match if the condition is satisfied.
>
> julia
>
OK, thank you very much.
We'll fix it soon.
--
Best Wishes,
Wen
Powered by blists - more mailing lists