Re: [PATCH v2] gpiolib: use the required minimum set of headers

Andy Shevchenko
2025-02-27T09:22:51Z

Wed, Feb 26, 2025 at 09:46:13PM +0000, David Laight kirjoitti:
> On Tue, 25 Feb 2025 12:44:21 +0200
> Andy Shevchenko <andriy.shevchenko@intel.com> wrote:
>
> > On Tue, Feb 25, 2025 at 10:52:10AM +0100, Bartosz Golaszewski wrote:
> > > From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> > >
> > > Andy suggested we should keep a fine-grained scheme for includes and
> > > only pull in stuff required within individual ifdef sections. Let's
> > > revert commit dea69f2d1cc8 ("gpiolib: move all includes to the top of
> > > gpio/consumer.h") and make the headers situation even more fine-grained
> > > by only including the first level headers containing requireded symbols
> > > except for bug.h where checkpatch.pl warns against including asm/bug.h.
> >
> > Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
> >
> > FWIW, I have checked the current state of affairs of linux/bug.h vs. asm/bug.h
> > and found no possible issues with the dependencies. While linux/bug.h drags
> > more than needed into this header it won't prevent cleaning up the rest of
> > the headers. So for now we can stick with linux/bug.h, but at some point it
> > would be better to be more pedantic on this.
> >
>
> A 'fun' activity is to pick a random file add "#define _IOW xxx" at the
> top and see where ioctl.h is is first included from.
> (I've not got a build machine up at the moment.)
>
> Then start fixing that include sequence.
> Moving a few headers around is otherwise pretty pointless.

Have you tried to help with reviewing this?

https://lwn.net/ml/linux-kernel/YdIfz+LMewetSaEB@gmail.com/

--
With Best Regards,
Andy Shevchenko