Re: [PATCH v3 6/8] gpiolib: avoid krealloc() in gpiod_get_array()
From: Linus Walleij
Date: Tue Nov 17 2026 - 05:18:54 EST
On Sat, Nov 7, 2026 at 12:13 PM Andy Shevchenko
<andy.shevchenko@xxxxxxxxx> wrote:
> On Fri, Nov 6, 2026 at 3:56 PM Linus Walleij <linusw@xxxxxxxxxx> wrote:
> > > + descs_size = struct_size(descs, desc, count);
> > > + bitmap_size = BITS_TO_LONGS(max(gdev->ngpio, count));
> > > + alloc_size = descs_size + struct_size(array_info, invert_mask, 3 * bitmap_size);
> >
> > Nitpick:
> > I know this is not your code, but if you respin try to add a comment
> > here explaining this 3 * bitmap_size.
>
> And the very next patch will remove that as it makes obvious what's
> going on. Since it's not a fix, I don't think we need such a
> short-live comment.
Ah you're right.
Yours,
Linus Walleij