Re: [Cocci] Easy search for elements besides binary operators with SmPL

2017-05-12 Thread SF Markus Elfring
>> I find it just strange that extra parentheses are needed in such an use case >> at the moment. > > ... is used in a number of contexts in SmPL, and sometimes its use has to > be restricted to avoid parsing ambiguities. I tried to use extra parentheses for other source code search patterns. I l

Re: [Cocci] Easy search for elements besides binary operators with SmPL

2017-05-12 Thread Julia Lawall
On Fri, 12 May 2017, SF Markus Elfring wrote: > >>> Maybe put parentheses around the second argument. An isomorphism will > >>> drop them and you will avoid whatever parsing issue is being encountered. > >> > >> I do not observe a desired improvement after such a SmPL code adjustment. > > > > Y

Re: [Cocci] Easy search for elements besides binary operators with SmPL

2017-05-12 Thread SF Markus Elfring
>>> Maybe put parentheses around the second argument. An isomorphism will >>> drop them and you will avoid whatever parsing issue is being encountered. >> >> I do not observe a desired improvement after such a SmPL code adjustment. > > Your change is not what I suggested either. The second argum

Re: [Cocci] Easy search for elements besides binary operators with SmPL

2017-05-12 Thread Julia Lawall
On Fri, 12 May 2017, SF Markus Elfring wrote: > > Maybe put parentheses around the second argument. An isomorphism will > > drop them and you will avoid whatever parsing issue is being encountered. > > I do not observe a desired improvement after such a SmPL code adjustment. Your change is not

Re: [Cocci] Easy search for elements besides binary operators with SmPL

2017-05-12 Thread SF Markus Elfring
> Maybe put parentheses around the second argument. An isomorphism will > drop them and you will avoid whatever parsing issue is being encountered. I do not observe a desired improvement after such a SmPL code adjustment. @find@ expression target; identifier action; @@ target = action(...,

[Cocci] Easy search for elements besides binary operators with SmPL

2017-05-12 Thread SF Markus Elfring
Hello, I would like to check also the application of elements which are used together with binary operators like the following. @find@ expression target; identifier action; @@ target = action(..., ... *| __GFP_NOFAIL | ..., ...)

Re: [Cocci] howto conditional match

2017-05-12 Thread Julia Lawall
On Fri, 12 May 2017, Arend van Spriel wrote: > On 5/12/2017 2:15 PM, Julia Lawall wrote: > > > > > > On Fri, 12 May 2017, Arend van Spriel wrote: > > > > > I have the following rule in my cocci script. Actually, want to apply the > > > patch conditionally, ie. when type S matches one or more str

Re: [Cocci] howto conditional match

2017-05-12 Thread Arend van Spriel
On 5/12/2017 2:15 PM, Julia Lawall wrote: On Fri, 12 May 2017, Arend van Spriel wrote: I have the following rule in my cocci script. Actually, want to apply the patch conditionally, ie. when type S matches one or more structure definitions. Initially I had 'struct Foo *drvr, ...' but that did

Re: [Cocci] howto conditional match

2017-05-12 Thread Julia Lawall
On Fri, 12 May 2017, Arend van Spriel wrote: > I have the following rule in my cocci script. Actually, want to apply the > patch conditionally, ie. when type S matches one or more structure > definitions. Initially I had 'struct Foo *drvr, ...' but that did not work for > me. Any hints are appre

[Cocci] howto conditional match

2017-05-12 Thread Arend van Spriel
I have the following rule in my cocci script. Actually, want to apply the patch conditionally, ie. when type S matches one or more structure definitions. Initially I had 'struct Foo *drvr, ...' but that did not work for me. Any hints are appreciated. Regards, Arend @@ identifier func; identif