Re: Replacing specific kmalloc() calls by kmalloc_array()?

From: SF Markus Elfring
Date: Wed Aug 24 2016 - 08:10:36 EST


> Or kmalloc_array, since zeroing is not necessary. Might be an idea for
> a new Coccinelle script, like
>
> - kmalloc (N * sizeof T, GFP)
> + kmalloc_array(N, sizeof T, GFP)

I have picked your idea up. The corresponding script for the semantic
patch language became longer than your general suggestion
(if additional source code control flow aspects are integrated).

Would it make sense to check any more function combinations
in a similar way?

Regards,
Markus