Re: [PATCH v5] Coccinelle: semantic code search for missing put_device()

2019-02-15 Thread Julia Lawall
On Fri, 15 Feb 2019, Markus Elfring wrote: > > +@search exists@ > > +local idexpression id; > > +expression x,e,e1; > > +position p1,p2; > > +type T,T1,T2,T3; > > +@@ > > + > > +id = of_find_device_by_node@p1(x) > > +... when != e = id > > +if (id == NULL || ...) { ... return ...; } > > +... whe

Re: [PATCH v5] Coccinelle: semantic code search for missing put_device()

2019-02-15 Thread Markus Elfring
> +@search exists@ > +local idexpression id; > +expression x,e,e1; > +position p1,p2; > +type T,T1,T2,T3; > +@@ > + > +id = of_find_device_by_node@p1(x) > +... when != e = id > +if (id == NULL || ...) { ... return ...; } > +... when != put_device(&id->dev) … > +when != if (id) { ... put_device(

Re: [PATCH v5] coccinelle: semantic code search for missing put_device()

2019-02-15 Thread Markus Elfring
> In a function, for a local variable returned by calling > of_find_device_by_node(), I suggest to reconsider this information once more. 1. Will an other wording be more appropriate for the storage of a function return value? 2. Can the restriction “local” be omitted? 3. Will any macros be