Re: [4/5] Coccinelle: put_device: Extend when constraints for two SmPL ellipses

From: Markus Elfring
Date: Mon May 13 2019 - 08:24:48 EST


>> Take additional casts for these code exclusion specifications into account
>> together with optional parentheses.
>
> NACK.

I find this rejection surprising.


> You don't need so many type metavariables.

I got an other software development opinion for this aspect.

Yesterday we started to clarify consequences from the isomorphism specification
âdrop_castâ (for SmPL code).
https://github.com/coccinelle/coccinelle/blob/32d3b89ad909316464344a5f61a8092d8d702321/standard.iso#L52

Information like the following influenced my design decision to add three
metavariables here.

elfring@Sonne:~/Projekte/Linux/next-patched> spatch --parse-cocci scripts/coccinelle/free/put_device.cocci
â
warning: iso drop_cast does not match the code below on line -1
T (T )id

pure metavariable T is matched against the following nonpure code:
T
â


> Type metavariables in the same ... can be the same.

I would find it also occasionally nice when multiple SmPL ellipses
can refer to identical type casts.

* The under-documented âtype purityâ hinders this at the moment.

* But I got the impression that it can be safer to distinguish these
code variants better.

Regards,
Markus