linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paul Gortmaker <paul.gortmaker@windriver.com>
To: linux-kernel@vger.kernel.org
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Alexandre Courbot <gnurou@gmail.com>,
	linux-gpio@vger.kernel.org
Subject: [PATCH 8/8] gpio: don't include module.h in shared driver header
Date: Mon, 12 Sep 2016 18:16:31 -0400	[thread overview]
Message-ID: <20160912221631.15812-9-paul.gortmaker@windriver.com> (raw)
In-Reply-To: <20160912221631.15812-1-paul.gortmaker@windriver.com>

Most shared headers in include/linux don't need to know what the
internals of a struct module are; all they care about is that it
is a struct and hence they may require a pointer to one.

The advantage in this is that module.h is including a lot of stuff
itself, and an otherwise empty C file that just contains module.h
will result in ~750kB from CPP (compared to say 12kB from init.h)

So we have approximately 50 instances of "struct module;" in the
various include/linux headers already that help us keep module.h
out of other headers; here we do the same for gpio.

Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Alexandre Courbot <gnurou@gmail.com>
Cc: linux-gpio@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 include/linux/gpio/driver.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h
index 50882e09289b..216e6f275aa8 100644
--- a/include/linux/gpio/driver.h
+++ b/include/linux/gpio/driver.h
@@ -3,7 +3,6 @@
 
 #include <linux/device.h>
 #include <linux/types.h>
-#include <linux/module.h>
 #include <linux/irq.h>
 #include <linux/irqchip/chained_irq.h>
 #include <linux/irqdomain.h>
@@ -16,6 +15,7 @@ struct of_phandle_args;
 struct device_node;
 struct seq_file;
 struct gpio_device;
+struct module;
 
 #ifdef CONFIG_GPIOLIB
 
-- 
2.8.4


  parent reply	other threads:[~2016-09-12 22:16 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-12 22:16 [PATCH 0/8] gpio: wean gpio/driver.h off of module.h Paul Gortmaker
2016-09-12 22:16 ` [PATCH 1/8] gpio: palmas: fix implicit assumption module.h is present Paul Gortmaker
2016-09-15 11:58   ` Linus Walleij
2016-09-12 22:16 ` [PATCH 2/8] gpio: sx150x: " Paul Gortmaker
2016-09-15 11:59   ` Linus Walleij
2016-09-12 22:16 ` [PATCH 3/8] gpio: ts4800: " Paul Gortmaker
2016-09-15 12:00   ` Linus Walleij
2016-09-12 22:16 ` [PATCH 4/8] gpio: altera: " Paul Gortmaker
2016-09-15 12:01   ` Linus Walleij
2016-09-12 22:16 ` [PATCH 5/8] gpio: ath79: " Paul Gortmaker
2016-09-15 12:02   ` Linus Walleij
2016-09-12 22:16 ` [PATCH 6/8] gpio: loongson1: " Paul Gortmaker
2016-09-15 12:03   ` Linus Walleij
2016-09-12 22:16 ` [PATCH 7/8] gpio: wcove: " Paul Gortmaker
2016-09-15 12:04   ` Linus Walleij
2016-09-12 22:16 ` Paul Gortmaker [this message]
2016-09-15 12:05   ` [PATCH 8/8] gpio: don't include module.h in shared driver header Linus Walleij

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=20160912221631.15812-9-paul.gortmaker@windriver.com \
    --to=paul.gortmaker@windriver.com \
    --cc=gnurou@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.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).