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

SF Markus Elfring elfring at users.sourceforge.net
Wed Dec 27 10:40:26 CET 2017

>>> - 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 data types?

>> The (T *) rule should be above this one, because that is for the case
>> where the cast is not needed.  I don't remember if this is done correctly.
>> Please check.
> Oops! Yes, I somehow hurriedly made the typo.

Does such a kind of feedback mean that the specification of pointer casts
will be adjusted once more for this evolving SmPL script?

Would you like to express the handling of optional items in a specific way?


More information about the Cocci mailing list