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.

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).

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:

> 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.