public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: Dipen Patel <dipenp@nvidia.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
	timestamp@lists.linux.dev,
	Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Subject: Re: [PATCH v4 1/2] gpiolib: move all includes to the top of gpio/consumer.h
Date: Wed, 19 Feb 2025 17:18:49 +0200	[thread overview]
Message-ID: <Z7X2We_IB2oShJ5w@smile.fi.intel.com> (raw)
In-Reply-To: <CAMRc=Mf6HLoORvth1O=DLGXcSvq75-mbmPR0zXg6cm6VV-LVWA@mail.gmail.com>

On Wed, Feb 19, 2025 at 06:35:59AM -0800, Bartosz Golaszewski wrote:
> On Wed, 19 Feb 2025 13:32:49 +0100, Andy Shevchenko
> <andriy.shevchenko@intel.com> said:
> > On Mon, Feb 17, 2025 at 11:39:21AM +0100, Bartosz Golaszewski wrote:
> >> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> >>
> >> We have several conditional includes depending on !CONFIG_GPIOLIB. This
> >> is supposed to reduce compilation time with CONFIG_GPIOLIB=y but in
> >> practice there's no difference on modern machines.
> >
> > It's not about modern machines. If every maintainer will think this way,
> > we end up in the complete and utter dead end with the headers.
> >
> > I believe you at least had read the cover letter for the infamous Ingo's series
> > about headers and how it speeds up the build (in some cases up to 70% on as you
> > said "modern machines").
> >
> >> It makes adding new stubs that depend on more than just GPIOLIB harder so
> >> move them all to the top, unduplicate them and replace asm/ with preferred
> >> linux/ alternatives.
> >
> > NAK.
> >
> > This makes dependency hell things much worse and this is a step back on the
> > untangling the current situation along with the slowing down the speed of the
> > build. Please. consider to revert or discard this patch.
> >
> > ...
> >
> >>  #include <linux/bits.h>
> >> +#include <linux/bug.h>
> >
> > Okay to replace, but not okay to move.
> >
> >>  #include <linux/err.h>
> >> +#include <linux/errno.h>
> >
> > Please, double check that it uses error codes from it, otherwise err.h includes
> > asm/errno.h with basic codes already.
> >
> >> +#include <linux/kernel.h>
> >
> > This is definitely no. Please, read what's written in the top of that file and
> > here is just a proxy for should come in the future a kind of might_sleep.h.
> > Do not move this one at all, please.
> >
> >>  #include <linux/types.h>


Fair enough. Does this look right to you?

For kernel.h definitely, for err.h you proved your point (but which was unclear
to me as the repetitions are already being in a number).

For bug.h looks also good. But I prefer to use asm/bug.h as it's the one that
provides the APIs. Note, the reference to the recommended linux/* headers
rather than asm/* applies to the C code or custom headers which are not under
include/*. The latter should be optimized to what it uses exactly.

So, summarizing the above I would return kernel.h to where it belongs and
move back to asm/bug.h.

-- 
With Best Regards,
Andy Shevchenko



      reply	other threads:[~2025-02-19 15:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-17 10:39 [PATCH v4 1/2] gpiolib: move all includes to the top of gpio/consumer.h Bartosz Golaszewski
2025-02-17 10:39 ` [PATCH v4 2/2] gpiolib: don't build HTE code with CONFIG_HTE disabled Bartosz Golaszewski
2025-02-19 22:24   ` Dipen Patel
2025-02-18 10:26 ` [PATCH v4 1/2] gpiolib: move all includes to the top of gpio/consumer.h Bartosz Golaszewski
2025-02-19 12:32 ` Andy Shevchenko
2025-02-19 14:35   ` Bartosz Golaszewski
2025-02-19 15:18     ` Andy Shevchenko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z7X2We_IB2oShJ5w@smile.fi.intel.com \
    --to=andriy.shevchenko@intel.com \
    --cc=bartosz.golaszewski@linaro.org \
    --cc=brgl@bgdev.pl \
    --cc=dipenp@nvidia.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=timestamp@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox