On 01/13/2017 07:01 AM, Julia Lawall wrote:
@m1 exists@
identifier initfn;
identifier pdev;
type ptype.T;
position p;
@@
initfn@p(T *pdev, ...) {
...
&pdev->dev
... when any
&pdev->dev
... when any
}
This is twice in a single execution path. Twice anywhere could be done as
follows:
@@
position p;
@@
initfn@p(T *pdev, ...) {
<...
&pdev@p->dev
...>
}
Then just inherit p into a python rule and find the number of elements in
the array.
Yes, of course you are right. That finds another 10+ files to transform
in drivers/input alone.
Thanks again!
Guenter
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci