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

From: Andy Shevchenko
Date: Tue Feb 25 2025 - 05:45:58 EST


On Tue, Feb 25, 2025 at 10:52:10AM +0100, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>
>
> 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@xxxxxxxxx>

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.

--
With Best Regards,
Andy Shevchenko