[PATCH] gpio: msc313: remove kcalloc

Gustavo A. R. Silva gustavo at embeddedor.com
Sun Mar 8 20:17:39 PDT 2026



On 3/9/26 10:27, Rosen Penev wrote:
> On Sun, Mar 8, 2026 at 5:06 PM Linus Walleij <linusw at kernel.org> wrote:
>>
>> On Sun, Mar 8, 2026 at 3:15 AM Rosen Penev <rosenp at gmail.com> wrote:
>>
>>> Use a flexible array member to combine kzalloc and kcalloc.
>>>
>>> Signed-off-by: Rosen Penev <rosenp at gmail.com>
>> (...)
>>>   struct msc313_gpio {
>>>          void __iomem *base;
>>>          const struct msc313_gpio_data *gpio_data;
>>
>> Do you wanna add:
>>
>> const unsigned int saved_size;
> So in the code there's
> 
> for (i = 0; i < gpio->gpio_data->num; i++)
> 
> which is equivalent to match->num.
> 
> __counted_by doesn't support pointers AFAIK.

We actually have __counted_by_ptr().

-Gustavo




More information about the linux-arm-kernel mailing list