From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: Rob Herring <robh+dt@kernel.org>,
Frank Rowand <frowand.list@gmail.com>,
Linus Walleij <linus.walleij@linaro.org>,
Bartosz Golaszewski <brgl@bgdev.pl>,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
linux-gpio@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH] gpio: Do not include <linux/kernel.h> when not really needed.
Date: Mon, 28 Nov 2022 12:14:25 +0200 [thread overview]
Message-ID: <Y4SKAbUM52tanAvc@smile.fi.intel.com> (raw)
In-Reply-To: <3f75784c57dc0682b5e1758daddd93fee6bb4b27.1669585920.git.christophe.jaillet@wanadoo.fr>
On Sun, Nov 27, 2022 at 10:52:10PM +0100, Christophe JAILLET wrote:
> <linux/kernel.h> is included only for using container_of().
> Include <linux/container_of.h> instead, it is much lighter.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Thanks for doing this! We really don't want to see kernel.h to be included by
other headers in the include/linux, include/asm, etc.
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> Not sure if the prefix should be gpio or gpiolib.
I'm not sure either because this more for the consumers, I would leave gpio.
> Let see if build-bots spot something which is inherit via kernel.h
> ---
> include/linux/of_gpio.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/linux/of_gpio.h b/include/linux/of_gpio.h
> index a5166eb93437..6db627257a7b 100644
> --- a/include/linux/of_gpio.h
> +++ b/include/linux/of_gpio.h
> @@ -34,7 +34,7 @@ enum of_gpio_flags {
>
> #ifdef CONFIG_OF_GPIO
>
> -#include <linux/kernel.h>
> +#include <linux/container_of.h>
>
> /*
> * OF GPIO chip for memory mapped banks
> --
> 2.34.1
>
>
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2022-11-28 10:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-27 21:52 [PATCH] gpio: Do not include <linux/kernel.h> when not really needed Christophe JAILLET
2022-11-27 22:07 ` Linus Walleij
2022-11-28 10:14 ` Andy Shevchenko [this message]
2022-11-28 17:58 ` Bartosz Golaszewski
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=Y4SKAbUM52tanAvc@smile.fi.intel.com \
--to=andriy.shevchenko@intel.com \
--cc=brgl@bgdev.pl \
--cc=christophe.jaillet@wanadoo.fr \
--cc=devicetree@vger.kernel.org \
--cc=frowand.list@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh+dt@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).