Re: [Cocci] Coccinelle: semantic patch for missing of_node_put

2019-06-03 Thread wen.yang99
> > 2, A general method. > > We also try to get the list of functions to consider by writing a SmPL, > > but this method is not feasible at present, because it is not easy to parse > > the comment > > header information of these functions. > > The situation was improved once more also for the

Re: Coccinelle: semantic patch for missing of_node_put

2019-06-03 Thread Markus Elfring
> 2, A general method. > We also try to get the list of functions to consider by writing a SmPL, > but this method is not feasible at present, because it is not easy to parse > the comment > header information of these functions. The situation was improved once more also for the Coccinelle

Re: [Cocci] Setting the match result by SmPL script rule

2019-06-03 Thread Markus Elfring
>> How do you think about to filter any text by regular expressions >> for semantic patch language constraints? > > Not supported. This software limitation and current development status has got consequences as usual. * It would be nice if comment contents could be directly restricted also by

Re: [Cocci] Indentation when adding an if

2019-06-03 Thread Julia Lawall
On Mon, 3 Jun 2019, Christoph Böhmwalder wrote: > Hi, > > Consider the following C code and cocci patch: > > #include > > int x; > > int main(int argc, char **argv) > { > if (y) > do_something(x); > } > > > @@ > identifier x; > @@ > - do_something(x); > + if (x) > +

[Cocci] Indentation when adding an if

2019-06-03 Thread Christoph Böhmwalder
Hi, Consider the following C code and cocci patch: #include int x; int main(int argc, char **argv) { if (y) do_something(x); } @@ identifier x; @@ - do_something(x); + if (x) + do_one_thing(); + else + do_another_thing(); For this input, spatch produces the