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

From: Viresh Kumar

Date: Tue Mar 17 2026 - 04:49:18 EST


On 16-03-26, 15:00, Linus Walleij wrote:
> On Fri, Mar 13, 2026 at 7:09 AM Viresh Kumar <viresh.kumar@xxxxxxxxxx> wrote:
>
> > I wonder if it is worth it anymore. Why combining allocations is better when we
> > are ending up using more memory ?
>
> For the same reason we are starting to use Rust in the kernel, despite
> it sometimes will take more memory essentially. __counted_by() enforce
> the same type of runtime size checks as Rust do on arrays.

Right. I don't have any issue with __counted_by(). It does the right thing for
flexible length arrays. But we don't need a flexible length array here and so my
question.

--
viresh