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

2017-03-03 Thread SF Markus Elfring
> This script finds instances of allocate and memset which can be > replaced with a direct call to zalloc equivalent of a function. What is the software development status for this SmPL script in comparison to an other directory for source code transformations?

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

2017-03-03 Thread SF Markus Elfring
> This script finds instances of allocate and memset which can be > replaced with a direct call to zalloc equivalent of a function. What is the software development status for this SmPL script in comparison to an other directory for source code transformations?

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

2016-08-19 Thread Julia Lawall
On Fri, 19 Aug 2016, Amitoj Kaur Chawla wrote: > On Mon, Aug 1, 2016 at 4:53 PM, SF Markus Elfring > wrote: > >> +@vz1 depends on patch && !context && !org && !report@ > >> +type T; > >> +T *d; > >> +statement S; > >> +@@ > >> + > >> +d = > >> +-

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

2016-08-19 Thread Julia Lawall
On Fri, 19 Aug 2016, Amitoj Kaur Chawla wrote: > On Mon, Aug 1, 2016 at 4:53 PM, SF Markus Elfring > wrote: > >> +@vz1 depends on patch && !context && !org && !report@ > >> +type T; > >> +T *d; > >> +statement S; > >> +@@ > >> + > >> +d = > >> +-vmalloc > >> ++

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

2016-08-19 Thread Amitoj Kaur Chawla
On Mon, Aug 1, 2016 at 4:53 PM, SF Markus Elfring wrote: >> +@vz1 depends on patch && !context && !org && !report@ >> +type T; >> +T *d; >> +statement S; >> +@@ >> + >> +d = >> +-vmalloc >> ++vzalloc >> + (...); >> +

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

2016-08-19 Thread Amitoj Kaur Chawla
On Mon, Aug 1, 2016 at 4:53 PM, SF Markus Elfring wrote: >> +@vz1 depends on patch && !context && !org && !report@ >> +type T; >> +T *d; >> +statement S; >> +@@ >> + >> +d = >> +-vmalloc >> ++vzalloc >> + (...); >> +if (!d) S >> +-

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

2016-08-01 Thread SF Markus Elfring
@vz_combined depends on patch && !context && !org && !report@ type T; T* pointer; +statement S; expression express; @@ pointer = - vmalloc + vzalloc (...); if (!d) S -memset(d, 0, sizeof(

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

2016-08-01 Thread SF Markus Elfring
@vz_combined depends on patch && !context && !org && !report@ type T; T* pointer; +statement S; expression express; @@ pointer = - vmalloc + vzalloc (...); if (!d) S -memset(d, 0, sizeof(

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

2016-08-01 Thread Julia Lawall
On Mon, 1 Aug 2016, SF Markus Elfring wrote: > >> How do you think about the following SmPL script example? > >> > >> @vz_combined > >> depends on patch && !context && !org && !report@ > >> type T; > >> T* pointer; > >> +statement S; > >> expression express; > >> @@ > >> pointer = > >> -

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

2016-08-01 Thread Julia Lawall
On Mon, 1 Aug 2016, SF Markus Elfring wrote: > >> How do you think about the following SmPL script example? > >> > >> @vz_combined > >> depends on patch && !context && !org && !report@ > >> type T; > >> T* pointer; > >> +statement S; > >> expression express; > >> @@ > >> pointer = > >> -

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

2016-08-01 Thread SF Markus Elfring
>> How do you think about the following SmPL script example? >> >> @vz_combined >> depends on patch && !context && !org && !report@ >> type T; >> T* pointer; >> +statement S; >> expression express; >> @@ >> pointer = >> - vmalloc >> + vzalloc >>(...); >> if (!d) >>

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

2016-08-01 Thread SF Markus Elfring
>> How do you think about the following SmPL script example? >> >> @vz_combined >> depends on patch && !context && !org && !report@ >> type T; >> T* pointer; >> +statement S; >> expression express; >> @@ >> pointer = >> - vmalloc >> + vzalloc >>(...); >> if (!d) >>

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

2016-08-01 Thread Julia Lawall
On Mon, 1 Aug 2016, SF Markus Elfring wrote: > >> 1. Would it make sense to merge such SmPL rules into one > >>so that code duplication could be reduced a bit > >>in such a script? > > > > I think it would suffer in readability. > > How do you think about the following SmPL script

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

2016-08-01 Thread Julia Lawall
On Mon, 1 Aug 2016, SF Markus Elfring wrote: > >> 1. Would it make sense to merge such SmPL rules into one > >>so that code duplication could be reduced a bit > >>in such a script? > > > > I think it would suffer in readability. > > How do you think about the following SmPL script

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

2016-08-01 Thread SF Markus Elfring
>> 1. Would it make sense to merge such SmPL rules into one >>so that code duplication could be reduced a bit >>in such a script? > > I think it would suffer in readability. How do you think about the following SmPL script example? @vz_combined depends on patch && !context && !org &&

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

2016-08-01 Thread SF Markus Elfring
>> 1. Would it make sense to merge such SmPL rules into one >>so that code duplication could be reduced a bit >>in such a script? > > I think it would suffer in readability. How do you think about the following SmPL script example? @vz_combined depends on patch && !context && !org &&

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

2016-08-01 Thread Julia Lawall
On Mon, 1 Aug 2016, SF Markus Elfring wrote: > > +@vz1 depends on patch && !context && !org && !report@ > > +type T; > > +T *d; > > +statement S; > > +@@ > > + > > +d = > > +-vmalloc > > ++vzalloc > > + (...); > > +if (!d) S > > +-

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

2016-08-01 Thread Julia Lawall
On Mon, 1 Aug 2016, SF Markus Elfring wrote: > > +@vz1 depends on patch && !context && !org && !report@ > > +type T; > > +T *d; > > +statement S; > > +@@ > > + > > +d = > > +-vmalloc > > ++vzalloc > > + (...); > > +if (!d) S > > +-

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

2016-08-01 Thread SF Markus Elfring
> +@vz1 depends on patch && !context && !org && !report@ > +type T; > +T *d; > +statement S; > +@@ > + > +d = > +-vmalloc > ++vzalloc > + (...); > +if (!d) S > +- memset(d, 0, sizeof(T)); > + > +@vz2 depends on patch && !context && !org &&

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

2016-08-01 Thread SF Markus Elfring
> +@vz1 depends on patch && !context && !org && !report@ > +type T; > +T *d; > +statement S; > +@@ > + > +d = > +-vmalloc > ++vzalloc > + (...); > +if (!d) S > +- memset(d, 0, sizeof(T)); > + > +@vz2 depends on patch && !context && !org &&

[PATCH v3] Coccinelle: Script to replace allocate and memset with zalloc functions

2016-08-01 Thread Amitoj Kaur Chawla
This script finds instances of allocate and memset which can be replaced with a direct call to zalloc equivalent of a function. Signed-off-by: Amitoj Kaur Chawla Acked-by: Julia Lawall --- Changes in v2: -Modified commit message and subject

[PATCH v3] Coccinelle: Script to replace allocate and memset with zalloc functions

2016-08-01 Thread Amitoj Kaur Chawla
This script finds instances of allocate and memset which can be replaced with a direct call to zalloc equivalent of a function. Signed-off-by: Amitoj Kaur Chawla Acked-by: Julia Lawall --- Changes in v2: -Modified commit message and subject Changes in v3: -Modified comment