Re: [PATCHv2] gpio: virtio: remove one kcalloc

From: Linus Walleij

Date: Wed Mar 11 2026 - 05:03:48 EST


On Wed, Mar 11, 2026 at 3:56 AM Rosen Penev <rosenp@xxxxxxxxx> wrote:

> A flexible array member can be used to combine allocations.
>
> Signed-off-by: Rosen Penev <rosenp@xxxxxxxxx>
> Acked-by: Viresh Kumar <viresh.kumar@xxxxxxxxxx>

unsigned int num_lines;

> +
> + struct virtio_gpio_line lines[];
> };

struct virtio_gpio_line lines[] __counted_by(num_lines);

I'm starting to get a slight feeling of déja vu here, we
want to use __counted_by() for all
of these.

Yours,
Linus Walleij