Re: [Cocci] Coccinelle: kzalloc-simple: Add more zero allocating functions

2017-12-27 Thread Julia Lawall
On Wed, 27 Dec 2017, SF Markus Elfring wrote: > >>> The cast is useful when it is to a non-pointer type. > >> > >> Will it be needed then to use an other metavariable for the assignment > >> target? > >> > >> How much would you like to distinguish if an item should handle a pointer > >> (or not

Re: [Cocci] Coccinelle: kzalloc-simple: Add more zero allocating functions

2017-12-27 Thread SF Markus Elfring
>>> The cast is useful when it is to a non-pointer type. >> >> Will it be needed then to use an other metavariable for the assignment >> target? >> >> How much would you like to distinguish if an item should handle a pointer >> (or not)? > > The compiler will complain about an assignment between

Re: [Cocci] Coccinelle: kzalloc-simple: Add more zero allocating functions

2017-12-27 Thread Julia Lawall
On Wed, 27 Dec 2017, SF Markus Elfring wrote: > > - x = (T)kmalloc(E1,E2); > > + x = (T)kzalloc(E1,E2); > > > > This for useless pointer cast which is done implicitily. > > Actually, the above rule is for the case where the cast is useful. > >> > >> * Have you got any s

Re: [Cocci] Coccinelle: kzalloc-simple: Add more zero allocating functions

2017-12-27 Thread SF Markus Elfring
> - x = (T)kmalloc(E1,E2); > + x = (T)kzalloc(E1,E2); > > This for useless pointer cast which is done implicitily. Actually, the above rule is for the case where the cast is useful. >> >> * Have you got any special aspects in mind here? >> >> * How do you think about to re

Re: [Cocci] Coccinelle: kzalloc-simple: Add more zero allocating functions

2017-12-27 Thread SF Markus Elfring
>>> - x = (T)kmalloc(E1,E2); >>> + x = (T)kzalloc(E1,E2); >>> >>> This for useless pointer cast which is done implicitily. >> >> Actually, the above rule is for the case where the cast is useful. * Have you got any special aspects in mind here? * How do you think about to restrict it for pointer

Re: [Cocci] Coccinelle: kzalloc-simple: Add more zero allocating functions

2017-12-27 Thread Julia Lawall
On Wed, 27 Dec 2017, SF Markus Elfring wrote: > >>> - x = (T)kmalloc(E1,E2); > >>> + x = (T)kzalloc(E1,E2); > >>> > >>> This for useless pointer cast which is done implicitily. > >> > >> Actually, the above rule is for the case where the cast is useful. > > * Have you got any special aspects in