aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorPaul Gortmaker <paul.gortmaker@windriver.com>2011-05-26 13:46:22 -0400
committerPaul Gortmaker <paul.gortmaker@windriver.com>2011-10-31 19:32:32 -0400
commitde47725421ad5627a5c905f4e40bb844ebc06d29 (patch)
treebc23b0405d4a79dcc866a8b2877f128ee0ea9ffc /include/linux
parentinclude: convert various register fcns to macros to avoid include chaining (diff)
downloadlinux-dev-de47725421ad5627a5c905f4e40bb844ebc06d29.tar.xz
linux-dev-de47725421ad5627a5c905f4e40bb844ebc06d29.zip
include: replace linux/module.h with "struct module" wherever possible
The <linux/module.h> pretty much brings in the kitchen sink along with it, so it should be avoided wherever reasonably possible in terms of being included from other commonly used <linux/something.h> files, as it results in a measureable increase on compile times. The worst culprit was probably device.h since it is used everywhere. This file also had an implicit dependency/usage of mutex.h which was masked by module.h, and is also fixed here at the same time. There are over a dozen other headers that simply declare the struct instead of pulling in the whole file, so follow their lead and simply make it a few more. Most of the implicit dependencies on module.h being present by these headers pulling it in have been now weeded out, so we can finally make this change with hopefully minimal breakage. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/blkdev.h2
-rw-r--r--include/linux/cpuidle.h3
-rw-r--r--include/linux/device.h3
-rw-r--r--include/linux/firmware.h2
-rw-r--r--include/linux/ftrace.h2
-rw-r--r--include/linux/i2c.h3
-rw-r--r--include/linux/ipmi.h3
-rw-r--r--include/linux/ipmi_smi.h1
-rw-r--r--include/linux/mdio-bitbang.h3
-rw-r--r--include/linux/mtd/mtd.h3
-rw-r--r--include/linux/regmap.h2
-rw-r--r--include/linux/sunrpc/svc_xprt.h3
-rw-r--r--include/linux/textsearch.h3
-rw-r--r--include/linux/uio_driver.h2
-rw-r--r--include/linux/vlynq.h3
15 files changed, 23 insertions, 15 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 7fbaa9103344..d750a3a79299 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -14,7 +14,6 @@
#include <linux/wait.h>
#include <linux/mempool.h>
#include <linux/bio.h>
-#include <linux/module.h>
#include <linux/stringify.h>
#include <linux/gfp.h>
#include <linux/bsg.h>
@@ -22,6 +21,7 @@
#include <asm/scatterlist.h>
+struct module;
struct scsi_ioctl_command;
struct request_queue;
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
index b51629e15cfc..583baf22cad2 100644
--- a/include/linux/cpuidle.h
+++ b/include/linux/cpuidle.h
@@ -13,7 +13,6 @@
#include <linux/percpu.h>
#include <linux/list.h>
-#include <linux/module.h>
#include <linux/kobject.h>
#include <linux/completion.h>
@@ -21,6 +20,8 @@
#define CPUIDLE_NAME_LEN 16
#define CPUIDLE_DESC_LEN 32
+struct module;
+
struct cpuidle_device;
diff --git a/include/linux/device.h b/include/linux/device.h
index 61f29f6a403d..8ff7dc801fd5 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -20,7 +20,7 @@
#include <linux/lockdep.h>
#include <linux/compiler.h>
#include <linux/types.h>
-#include <linux/module.h>
+#include <linux/mutex.h>
#include <linux/pm.h>
#include <linux/atomic.h>
#include <asm/device.h>
@@ -29,6 +29,7 @@ struct device;
struct device_private;
struct device_driver;
struct driver_private;
+struct module;
struct class;
struct subsys_private;
struct bus_type;
diff --git a/include/linux/firmware.h b/include/linux/firmware.h
index 21b3e7588abd..1e7c01189fa6 100644
--- a/include/linux/firmware.h
+++ b/include/linux/firmware.h
@@ -1,7 +1,6 @@
#ifndef _LINUX_FIRMWARE_H
#define _LINUX_FIRMWARE_H
-#include <linux/module.h>
#include <linux/types.h>
#include <linux/compiler.h>
#include <linux/gfp.h>
@@ -15,6 +14,7 @@ struct firmware {
struct page **pages;
};
+struct module;
struct device;
struct builtin_fw {
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index f0c0e8a47ae6..26eafcef75be 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -10,7 +10,6 @@
#include <linux/kallsyms.h>
#include <linux/linkage.h>
#include <linux/bitops.h>
-#include <linux/module.h>
#include <linux/ktime.h>
#include <linux/sched.h>
#include <linux/types.h>
@@ -19,6 +18,7 @@
#include <asm/ftrace.h>
+struct module;
struct ftrace_hash;
#ifdef CONFIG_FUNCTION_TRACER
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 1be303bfc254..a81bf6d23b3e 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -28,7 +28,6 @@
#include <linux/types.h>
#ifdef __KERNEL__
-#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/device.h> /* for struct device */
#include <linux/sched.h> /* for completion */
@@ -49,6 +48,8 @@ struct i2c_driver;
union i2c_smbus_data;
struct i2c_board_info;
+struct module;
+
#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
/*
* The master routines are the ones normally used to transmit data to devices
diff --git a/include/linux/ipmi.h b/include/linux/ipmi.h
index ca85cf894e33..bbd156bb953b 100644
--- a/include/linux/ipmi.h
+++ b/include/linux/ipmi.h
@@ -220,10 +220,11 @@ struct kernel_ipmi_msg {
* The in-kernel interface.
*/
#include <linux/list.h>
-#include <linux/module.h>
#include <linux/device.h>
#include <linux/proc_fs.h>
+struct module;
+
/* Opaque type for a IPMI message user. One of these is needed to
send and receive messages. */
typedef struct ipmi_user *ipmi_user_t;
diff --git a/include/linux/ipmi_smi.h b/include/linux/ipmi_smi.h
index 204f9cd26c16..3ef0d8b6aa6f 100644
--- a/include/linux/ipmi_smi.h
+++ b/include/linux/ipmi_smi.h
@@ -36,7 +36,6 @@
#include <linux/ipmi_msgdefs.h>
#include <linux/proc_fs.h>
-#include <linux/module.h>
#include <linux/device.h>
#include <linux/platform_device.h>
#include <linux/ipmi.h>
diff --git a/include/linux/mdio-bitbang.h b/include/linux/mdio-bitbang.h
index 8ea9a42a4c02..0fe00cd4c93c 100644
--- a/include/linux/mdio-bitbang.h
+++ b/include/linux/mdio-bitbang.h
@@ -2,7 +2,8 @@
#define __LINUX_MDIO_BITBANG_H
#include <linux/phy.h>
-#include <linux/module.h>
+
+struct module;
struct mdiobb_ctrl;
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index 2541fb848daa..37be05bbfbc8 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -21,7 +21,6 @@
#define __MTD_MTD_H__
#include <linux/types.h>
-#include <linux/module.h>
#include <linux/uio.h>
#include <linux/notifier.h>
#include <linux/device.h>
@@ -125,6 +124,8 @@ struct nand_ecclayout {
struct nand_oobfree oobfree[MTD_MAX_OOBFREE_ENTRIES_LARGE];
};
+struct module; /* only needed for owner field in mtd_info */
+
struct mtd_info {
u_char type;
uint32_t flags;
diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index 3daac2d8dc37..690276a642cf 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -15,8 +15,8 @@
#include <linux/device.h>
#include <linux/list.h>
-#include <linux/module.h>
+struct module;
struct i2c_client;
struct spi_device;
diff --git a/include/linux/sunrpc/svc_xprt.h b/include/linux/sunrpc/svc_xprt.h
index 7ad9751a0d87..8620f79658d4 100644
--- a/include/linux/sunrpc/svc_xprt.h
+++ b/include/linux/sunrpc/svc_xprt.h
@@ -8,7 +8,8 @@
#define SUNRPC_SVC_XPRT_H
#include <linux/sunrpc/svc.h>
-#include <linux/module.h>
+
+struct module;
struct svc_xprt_ops {
struct svc_xprt *(*xpo_create)(struct svc_serv *,
diff --git a/include/linux/textsearch.h b/include/linux/textsearch.h
index d9a85d616385..cfaee869146f 100644
--- a/include/linux/textsearch.h
+++ b/include/linux/textsearch.h
@@ -4,10 +4,11 @@
#include <linux/types.h>
#include <linux/list.h>
#include <linux/kernel.h>
-#include <linux/module.h>
#include <linux/err.h>
#include <linux/slab.h>
+struct module;
+
struct ts_config;
#define TS_AUTOLOAD 1 /* Automatically load textsearch modules when needed */
diff --git a/include/linux/uio_driver.h b/include/linux/uio_driver.h
index 73898189a97c..1ad4724458de 100644
--- a/include/linux/uio_driver.h
+++ b/include/linux/uio_driver.h
@@ -14,10 +14,10 @@
#ifndef _UIO_DRIVER_H_
#define _UIO_DRIVER_H_
-#include <linux/module.h>
#include <linux/fs.h>
#include <linux/interrupt.h>
+struct module;
struct uio_map;
/**
diff --git a/include/linux/vlynq.h b/include/linux/vlynq.h
index 8f6a95882b09..017d4a53d55e 100644
--- a/include/linux/vlynq.h
+++ b/include/linux/vlynq.h
@@ -20,9 +20,10 @@
#define __VLYNQ_H__
#include <linux/device.h>
-#include <linux/module.h>
#include <linux/types.h>
+struct module;
+
#define VLYNQ_NUM_IRQS 32
struct vlynq_mapping {