Re: [Cocci] Checking the “display” of last two statements in code blocks

2019-04-12 Thread Markus Elfring
>> @@ -3015,11 +2859,6 @@ static int init_slave(struct gbe_priv *g >> } >> >> if (of_property_read_u32(node, "link-interface", >> ->link_interface)) { >> - dev_warn(gbe_dev->dev, >> -"missing link-interface value

Re: [Cocci] Clarification for SmPL asterisk functionality

2019-04-12 Thread Markus Elfring
> The asterisk functionality has no goal of making code that compiles. How do you think about to add this information to the manual for the semantic patch language? Regards, Markus ___ Cocci mailing list Cocci@systeme.lip6.fr

Re: [Cocci] Checking the “display” of last two statements in code blocks

2019-04-12 Thread Julia Lawall
On Fri, 12 Apr 2019, Markus Elfring wrote: > >> @@ -3015,11 +2859,6 @@ static int init_slave(struct gbe_priv *g > >> } > >> > >> if (of_property_read_u32(node, "link-interface", > >> ->link_interface)) { > >> - dev_warn(gbe_dev->dev,

Re: [Cocci] Searching for duplicate statements in if branches (with SmPL)?

2019-04-12 Thread Markus Elfring
>>> If you want to be sure that you aren't in a loop, >> >> I do not want to filter on this implementation detail for the shown analysis >> approach. > > I don't know what you mean by "I do not want to". I suggest to improve this clarification by additional case distinctions. > You mean that

Re: [Cocci] Checking the “display” of last two statements in code blocks

2019-04-12 Thread Julia Lawall
On Fri, 12 Apr 2019, Markus Elfring wrote: > Hello, > > I have tried another small SmPL script out. > > > @display@ > identifier work; > statement s1, s2; > type T; > @@ > T work(...) > { > ... when any > *{ > ... when any > * s1 > * s2 > *} > ... when any > } > > > I have observed

[Cocci] Checking the “display” of last two statements in code blocks

2019-04-12 Thread Markus Elfring
Hello, I have tried another small SmPL script out. @display@ identifier work; statement s1, s2; type T; @@ T work(...) { ... when any *{ ... when any * s1 * s2 *} ... when any } I have observed then that the following diff hunk was generated.

Re: [Cocci] Searching for duplicate statements in if branches (with SmPL)?

2019-04-12 Thread Markus Elfring
> If you want to be sure that you aren't in a loop, I do not want to filter on this implementation detail for the shown analysis approach. > you have to ue position variables to be sure that the two matched fragments > are different. I find this information questionable. * How should source