Re: [Cocci] [PATCH] Coccinelle: Script to replace allocate and memcpy with zalloc functions

2016-07-23 Thread Julia Lawall
On Sun, 24 Jul 2016, Amitoj Kaur Chawla wrote: > This script finds instances of allocate and memcpy which can be > replaced with a direct call to zalloc equivalent of a function. > > Signed-off-by: Amitoj Kaur Chawla Acked-by: Julia Lawall > --- > scripts/coccinelle/api/zalloc.cocci | 556 > +

[Cocci] [PATCH] Coccinelle: Script to replace allocate and memcpy with zalloc functions

2016-07-23 Thread Amitoj Kaur Chawla
This script finds instances of allocate and memcpy which can be replaced with a direct call to zalloc equivalent of a function. Signed-off-by: Amitoj Kaur Chawla --- scripts/coccinelle/api/zalloc.cocci | 556 1 file changed, 556 insertions(+) create mode 100

Re: [Cocci] Better documentation around SmPL ellipsis usage?

2016-07-23 Thread SF Markus Elfring
>> https://github.com/coccinelle/coccinelle/blob/3b52bd3c6960dc996186e1c58c96355db288825c/docs/manual/cocci_syntax.tex#L632 > > About the same as the chance that someone will make a patch suitable for > adding the information. I would find it hard to extract mentioned constraints from the OCaml s

Re: [Cocci] Better documentation around SmPL ellipsis usage?

2016-07-23 Thread Julia Lawall
On Sat, 23 Jul 2016, SF Markus Elfring wrote: > > The <+... ...+> starts the matching process at the beginning of the > > function and ends it at the end of the function, instead of just working > > on each if one by one. Thus <+... ...+> should be much less efficient. > > Also with <+... ...+>

Re: [Cocci] Better documentation around SmPL ellipsis usage?

2016-07-23 Thread Julia Lawall
On Sat, 23 Jul 2016, SF Markus Elfring wrote: > > The <+... ...+> starts the matching process at the beginning of the > > function and ends it at the end of the function, instead of just working > > on each if one by one. Thus <+... ...+> should be much less efficient. > > Also with <+... ...+>

Re: [Cocci] Better documentation around SmPL ellipsis usage?

2016-07-23 Thread SF Markus Elfring
> The <+... ...+> starts the matching process at the beginning of the > function and ends it at the end of the function, instead of just working > on each if one by one. Thus <+... ...+> should be much less efficient. > Also with <+... ...+> if you put a position variable on eg the if, you > will

Re: [Cocci] [PATCH RFC] coccinelle: tests: if and else branch should probably not be identical

2016-07-23 Thread Nicholas Mc Guire
On Fri, Jul 22, 2016 at 06:56:47PM +0200, Julia Lawall wrote: > > +virtual context > > +virtual org > > +virtual report > > + > > +@cond@ > > +statement S1; > > +position p; > > +@@ > > + > > +<+... > > +* if@p (...) S1 else S1 > > +...+> > > You don't need the <+... ...+>. Just put the if by its

Re: [Cocci] [PATCH RFC] coccinelle: tests: if and else branch should probably not be identical

2016-07-23 Thread Julia Lawall
On Fri, 22 Jul 2016, Nicholas Mc Guire wrote: > On Fri, Jul 22, 2016 at 06:56:47PM +0200, Julia Lawall wrote: > > > +virtual context > > > +virtual org > > > +virtual report > > > + > > > +@cond@ > > > +statement S1; > > > +position p; > > > +@@ > > > + > > > +<+... > > > +* if@p (...) S1 else S