lkml.org 
[lkml]   [2020]   [Jan]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2] coccinelle: semantic patch to check for inappropriate do_div() calls
From
Date


On 2020/1/8 1:25 上午, Julia Lawall wrote:
>> +@depends 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

\
 
 \ /
  Last update: 2020-01-10 14:13    [W:0.086 / U:2.760 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site