diff options
author | Paul Gortmaker <paul.gortmaker@windriver.com> | 2017-01-29 05:05:57 +0300 |
---|---|---|
committer | James Hogan <james.hogan@imgtec.com> | 2017-02-14 12:00:25 +0300 |
commit | 26dd3e4ff9ac1aa576c97d23d7425d2544dbc5bf (patch) | |
tree | 847dd13b8e87ae1a4dfcf20bef370728e2177e54 /arch/mips/dec | |
parent | 2654294bac83a64101c360eac4d42d5ac1b1b911 (diff) | |
download | linux-26dd3e4ff9ac1aa576c97d23d7425d2544dbc5bf.tar.xz |
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 <paul.gortmaker@windriver.com>
Cc: David Daney <david.daney@cavium.com>
Cc: John Crispin <john@phrozen.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: "Steven J. Hill" <steven.hill@cavium.com>
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 <james.hogan@imgtec.com>
Diffstat (limited to 'arch/mips/dec')
-rw-r--r-- | arch/mips/dec/prom/identify.c | 2 | ||||
-rw-r--r-- | arch/mips/dec/setup.c | 2 | ||||
-rw-r--r-- | arch/mips/dec/wbflush.c | 4 |
3 files changed, 3 insertions, 5 deletions
diff --git a/arch/mips/dec/prom/identify.c b/arch/mips/dec/prom/identify.c index 95e26f4bb38f..0c14a9d6a84a 100644 --- a/arch/mips/dec/prom/identify.c +++ b/arch/mips/dec/prom/identify.c @@ -7,7 +7,7 @@ #include <linux/init.h> #include <linux/kernel.h> #include <linux/mc146818rtc.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/string.h> #include <linux/types.h> diff --git a/arch/mips/dec/setup.c b/arch/mips/dec/setup.c index 1c3bf9fe926f..61a0bf13e308 100644 --- a/arch/mips/dec/setup.c +++ b/arch/mips/dec/setup.c @@ -9,12 +9,12 @@ * Copyright (C) 2000, 2001, 2002, 2003, 2005 Maciej W. Rozycki */ #include <linux/console.h> +#include <linux/export.h> #include <linux/init.h> #include <linux/interrupt.h> #include <linux/ioport.h> #include <linux/irq.h> #include <linux/irqnr.h> -#include <linux/module.h> #include <linux/param.h> #include <linux/percpu-defs.h> #include <linux/sched.h> diff --git a/arch/mips/dec/wbflush.c b/arch/mips/dec/wbflush.c index 56bda4a396b5..dad64d1789b2 100644 --- a/arch/mips/dec/wbflush.c +++ b/arch/mips/dec/wbflush.c @@ -14,6 +14,7 @@ * Copyright (C) 2002 Maciej W. Rozycki */ +#include <linux/export.h> #include <linux/init.h> #include <asm/bootinfo.h> @@ -88,7 +89,4 @@ static void wbflush_mips(void) { __fast_iob(); } - -#include <linux/module.h> - EXPORT_SYMBOL(__wbflush); |