[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMRc=MdDmPumdsrJ0ELPSgRB9UBzW8LcGBRSt5N71eZy21oDAA@mail.gmail.com>
Date: Wed, 3 Sep 2025 18:16:12 +0200
From: Bartosz Golaszewski <brgl@...ev.pl>
To: Andy Shevchenko <andriy.shevchenko@...el.com>
Cc: Linus Walleij <linus.walleij@...aro.org>, Yinbo Zhu <zhuyinbo@...ngson.cn>,
Hoan Tran <hoan@...amperecomputing.com>, Manivannan Sadhasivam <mani@...nel.org>,
Yang Shen <shenyang39@...wei.com>, linux-gpio@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-unisoc@...ts.infradead.org,
Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
Subject: Re: [PATCH RESEND 09/14] gpio: dwapb: use new generic GPIO chip API
On Wed, Sep 3, 2025 at 5:51 PM Andy Shevchenko
<andriy.shevchenko@...el.com> wrote:
>
> On Mon, Aug 25, 2025 at 11:48:50AM +0200, Bartosz Golaszewski wrote:
> > From: Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
> >
> > Convert the driver to using the new generic GPIO chip interfaces from
> > linux/gpio/generic.h.
>
> ...
>
> > +static inline struct dwapb_gpio *to_dwapb_gpio(struct gpio_chip *gc)
> > +{
> > + return container_of(to_gpio_generic_chip(gc),
> > + struct dwapb_gpio_port, chip)->gpio;
> > +}
>
> Since it's not a macro anymore it can be done better:
>
> struct dwapb_gpio_port *port;
>
> port = container_of(to_gpio_generic_chip(gc), struct dwapb_gpio_port, chip);
> return port->gpio;
>
Sure. I already applied it so can you send a follow-up?
> Also, have you checked the bloat-o-meter before and after, wondering if we gain
> something with this.
>
Not yet we don't but we will move the gpio-mmio-specific fields out of
struct gpio_chip so we'll gain several fields worth of memory per
non-generic chip system-wide.
Bart
Powered by blists - more mailing lists