Message ID | 3f75784c57dc0682b5e1758daddd93fee6bb4b27.1669585920.git.christophe.jaillet@wanadoo.fr |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp5308597wrr; Sun, 27 Nov 2022 14:08:56 -0800 (PST) X-Google-Smtp-Source: AA0mqf7BGjrtI3nAMC8CIDP1Eb9SWQfYDwAhfu/IeNyHdZpCNILxgldrQLTLGaOGKJ37+aTQkU9/ X-Received: by 2002:a50:fc8b:0:b0:46b:4b13:e18d with SMTP id f11-20020a50fc8b000000b0046b4b13e18dmr241434edq.181.1669586936235; Sun, 27 Nov 2022 14:08:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669586936; cv=none; d=google.com; s=arc-20160816; b=VwgTfyI9WsUXdGO2YQBn42bGoXENa/jKvTrppcI9ZJoNPUBrLeHc0kUUEsh85d0gzz k93TOEcQ920SvMW75IoMu19RmwcX51EtGKV113Kc93AMHUh8+/F1AngY2Nynba5TdmDJ tCK2pIhyMmo6uRnART7Dg5EYiKDfVqE+P5tL2yKKzPul6Z5KAf5cwCXEN+QBM4ud0nPh 3UiGfOXDpgnkScJ/zy5Xl8EzVw3QiIUOKQu8Zyi4oaPxd1IShePt9ZPwv5caJ0aJzfJk P9o4WmqzwHU2EdQ+qiiUTn/CwtNak9U8zz4LpPsg7XEcg4KFGwdKGoTtLPv3McqqVC5L X97w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=N0HbT3wNyQh8ZRwgGWZRu1cZYeMy3E2Tzk++9KIcnG8=; b=rkyCbpPppdbK7q16ey9a0zkAbKne65GoSzq41tZoejFcnpX6t7GNLSzM0l/hswjrUC vZdLjS/UNwExEejo2jQ82sokrssZ2iemYeEuJYE5/D2hH11ihL/nydpbA7f25MdmwXD3 xeTOSRiiDtxPtjlVEuVQgumUvbpXZKK5j6AXtFCWQqsJXxuPSr+dK1TchaHH3LjWf+gJ 3+Xs4K8FyNx5P1b5pNkrBL92reOAHivdLEO6ncS+oQMTJwa1tLbSQBKKS2G08QnhS56l cIAMbTcmxsnP8ogIiFKzKlWeUdeVlhE0qH4sYDJarJMj/2jNpGwrYXvnRnx0a6JdtCR0 xFPg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id xj14-20020a170906db0e00b007a641e472f0si9113631ejb.139.2022.11.27.14.08.31; Sun, 27 Nov 2022 14:08:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229732AbiK0VwR (ORCPT <rfc822;gah0developer@gmail.com> + 99 others); Sun, 27 Nov 2022 16:52:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229644AbiK0VwQ (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 27 Nov 2022 16:52:16 -0500 Received: from smtp.smtpout.orange.fr (smtp-18.smtpout.orange.fr [80.12.242.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD692B7F0 for <linux-kernel@vger.kernel.org>; Sun, 27 Nov 2022 13:52:14 -0800 (PST) Received: from pop-os.home ([86.243.100.34]) by smtp.orange.fr with ESMTPA id zPZLoGIZNzQOKzPZLocc9q; Sun, 27 Nov 2022 22:52:12 +0100 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 27 Nov 2022 22:52:12 +0100 X-ME-IP: 86.243.100.34 From: Christophe JAILLET <christophe.jaillet@wanadoo.fr> To: Rob Herring <robh+dt@kernel.org>, Frank Rowand <frowand.list@gmail.com>, Linus Walleij <linus.walleij@linaro.org>, Bartosz Golaszewski <brgl@bgdev.pl> Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET <christophe.jaillet@wanadoo.fr>, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH] gpio: Do not include <linux/kernel.h> when not really needed. Date: Sun, 27 Nov 2022 22:52:10 +0100 Message-Id: <3f75784c57dc0682b5e1758daddd93fee6bb4b27.1669585920.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750688791170014379?= X-GMAIL-MSGID: =?utf-8?q?1750688791170014379?= |
Series |
gpio: Do not include <linux/kernel.h> when not really needed.
|
|
Commit Message
Christophe JAILLET
Nov. 27, 2022, 9:52 p.m. UTC
<linux/kernel.h> is included only for using container_of().
Include <linux/container_of.h> instead, it is much lighter.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
Not sure if the prefix should be gpio or gpiolib.
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(-)
Comments
On Sun, Nov 27, 2022 at 10:52 PM Christophe JAILLET <christophe.jaillet@wanadoo.fr> wrote: > <linux/kernel.h> is included only for using container_of(). > Include <linux/container_of.h> instead, it is much lighter. > > Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> This is fine. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> As Andy split out the container_of header file a year ago or so he certainly want to ACK this too. Yours, Linus Walleij
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 > >
On Sun, Nov 27, 2022 at 10:52 PM Christophe JAILLET <christophe.jaillet@wanadoo.fr> wrote: > > <linux/kernel.h> is included only for using container_of(). > Include <linux/container_of.h> instead, it is much lighter. > > Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> > --- > Not sure if the prefix should be gpio or gpiolib. > > 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 > Applied, thanks! Bartosz
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