Re: [PATCH v2 5/6] gpiolib: cdev: don't leak the IRQ name when the chip is removed

From: Andy Shevchenko

Date: Wed Oct 21 2026 - 02:54:32 EST


On Tue, Oct 20, 2026 at 03:59:24PM +0300, Adrian Ambrozewicz wrote:
> On Fri, Oct 16, 2026 at 04:41:23PM +0300, Andy Shevchenko wrote:

...

> > > struct line {
> >
> > > struct linereq *req;
> > > unsigned int irq;
> > > + char *irq_label;
> >
> > Have you checked this with `pahole`? Is it good layout?
>
> Yes, on x86_64 (with gdb's ptype /o, which reads the same debug info
> as pahole). struct line already had a 4-byte hole after irq, at offset
> 20. irq_label goes after that hole, at offset 24, so the struct grows
> by the 8 bytes of the pointer and gets no new hole.

But if you move it up, can't you get rid of the 4-byte hole?

...

> > > struct lineevent_state {
> >
> > > struct gpio_desc *desc;
> > > u32 eflags;
> > > int irq;
> > > + char *irq_label;
> >
> > Ditto.
>
> irq_label lands at offset 32, right after eflags and irq, so no hole
> here either.

This sounds good, thanks.

--
With Best Regards,
Andy Shevchenko