Re: [Cocci] [PATCH v2 1/4] coccinelle: api: extend memdup_user transformation with GFP_USER

2020-06-09 Thread Markus Elfring
… > +++ b/scripts/coccinelle/api/memdup_user.cocci > @@ -20,7 +20,9 @@ expression from,to,size; … > +- to = \(kmalloc\|kzalloc\) > + (size,\(GFP_KERNEL\|GFP_USER\| > + \(GFP_KERNEL\|GFP_USER\)|__GFP_NOWARN\)); I got the impression that this SmPL code needs another

Re: [Cocci] [PATCH v2 4/4] coccinelle: api: add selfcheck for memdup_user rule

2020-06-09 Thread Julia Lawall
On Mon, 8 Jun 2020, Denis Efremov wrote: > Check that the rule matches vmemdup_user implementation. > memdup_user is out of scope because we are not matching > kmalloc_track_caller() function. Is this a bit over-enginered? More precisely, even if it is nice to check that the API definition

Re: [Cocci] Checking software behaviour according to selected SmPL code variants

2020-06-09 Thread Julia Lawall
On Tue, 9 Jun 2020, Markus Elfring wrote: > Hello, > > My software development attention was caught also by a recent patch. > https://lore.kernel.org/linux-fsdevel/20200608141629.GA1912173@mwanda/ > https://lore.kernel.org/patchwork/patch/1253499/ > > Thus I have tried another tiny script out

[Cocci] Checking software behaviour according to selected SmPL code variants

2020-06-09 Thread Markus Elfring
Hello, My software development attention was caught also by a recent patch. https://lore.kernel.org/linux-fsdevel/20200608141629.GA1912173@mwanda/ https://lore.kernel.org/patchwork/patch/1253499/ Thus I have tried another tiny script out for the semantic patch language (according to the software

Re: [Cocci] Checking software behaviour according to selected SmPL code variants

2020-06-09 Thread Markus Elfring
>> If I omit the specification “, ...” from the function call parameters >> because I could be unsure about the number of arguments in other >> software situations, I do not get the desired test output as before. > > This has been discussed before. I was just looking for a related update in this

Re: [Cocci] [PATCH v2 4/4] coccinelle: api: add selfcheck for memdup_user rule

2020-06-09 Thread Markus Elfring
… > +++ b/scripts/coccinelle/api/memdup_user.cocci > @@ -14,13 +14,24 @@ virtual patch > virtual context > virtual org > virtual report > +virtual selfcheck Would you like to avoid the repetition of a SmPL key word here? +virtual patch, context, org, report, selfcheck > @@ -117,3 +128,34 @@

Re: [Cocci] [PATCH 0/4] parsing_c: parser: Add end_attributes_opt rule

2020-06-09 Thread Julia Lawall
On Mon, 8 Jun 2020, Jaskaran Singh wrote: > Patches for improving the C parsing of attributes[1] introduced a lot > redundant code in the C parser. This patch series resolves this by adding > a rule for optional end attributes and merging the redundant code > together. All are applied,