From 26dd3e4ff9ac1aa576c97d23d7425d2544dbc5bf Mon Sep 17 00:00:00 2001 From: Paul Gortmaker Date: Sat, 28 Jan 2017 21:05:57 -0500 Subject: MIPS: Audit and remove any unnecessary uses of module.h Historically a lot of these existed because we did not have a distinction between what was modular code and what was providing support to modules via EXPORT_SYMBOL and friends. That changed when we forked out support for the latter into the export.h file. This means we should be able to reduce the usage of module.h in code that is obj-y Makefile or bool Kconfig. In the case of some code where it is modular, we can extend that to also include files that are building basic support functionality but not related to loading or registering the final module; such files also have no need whatsoever for module.h The advantage in removing such instances is that module.h itself sources about 15 other headers; adding significantly to what we feed cpp, and it can obscure what headers we are effectively using. Since module.h might have been the implicit source for init.h (for __init) and for export.h (for EXPORT_SYMBOL) we consider each instance for the presence of either and replace/add as needed. Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code. Build coverage of all the mips defconfigs revealed the module.h header was masking a couple of implicit include instances, so we add the appropriate headers there. Signed-off-by: Paul Gortmaker Cc: David Daney Cc: John Crispin Cc: Ralf Baechle Cc: "Steven J. Hill" Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/15131/ [james.hogan@imgtec.com: Preserve sort order where it already exists] Signed-off-by: James Hogan --- arch/mips/jz4740/gpio.c | 2 +- arch/mips/jz4740/prom.c | 1 - arch/mips/jz4740/timer.c | 3 ++- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'arch/mips/jz4740') diff --git a/arch/mips/jz4740/gpio.c b/arch/mips/jz4740/gpio.c index b765773ab8aa..cac1ccde2214 100644 --- a/arch/mips/jz4740/gpio.c +++ b/arch/mips/jz4740/gpio.c @@ -14,7 +14,7 @@ */ #include -#include +#include #include #include diff --git a/arch/mips/jz4740/prom.c b/arch/mips/jz4740/prom.c index 6984683c90d0..47e857194ce6 100644 --- a/arch/mips/jz4740/prom.c +++ b/arch/mips/jz4740/prom.c @@ -13,7 +13,6 @@ * */ -#include #include #include #include diff --git a/arch/mips/jz4740/timer.c b/arch/mips/jz4740/timer.c index 4992461787aa..777877feef71 100644 --- a/arch/mips/jz4740/timer.c +++ b/arch/mips/jz4740/timer.c @@ -13,9 +13,10 @@ * */ +#include #include +#include #include -#include #include #include -- cgit v1.2.3