x86/platform: Audit and remove any unnecessary uses of module.h
authorPaul Gortmaker <paul.gortmaker@windriver.com>
Thu, 14 Jul 2016 00:18:58 +0000 (20:18 -0400)
committerIngo Molnar <mingo@kernel.org>
Thu, 14 Jul 2016 13:06:59 +0000 (15:06 +0200)
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.  The advantage
in doing so 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 was the source for init.h (for __init) and for
export.h (for EXPORT_SYMBOL) we consider each obj-y/bool instance
for the presence of either and replace as needed.

One module.h was converted to moduleparam.h since the file had
multiple module_param() in it, and another file had an instance of
MODULE_DEVICE_TABLE deleted, since that is a no-op when builtin.

Finally, the 32 bit build coverage of olpc_ofw revealed a couple
implicit includes, which were pretty self evident to fix based on
what gcc was complaining about.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20160714001901.31603-6-paul.gortmaker@windriver.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/platform/ce4100/ce4100.c
arch/x86/platform/efi/efi_64.c
arch/x86/platform/intel-mid/intel-mid.c
arch/x86/platform/intel-mid/pwr.c
arch/x86/platform/intel-mid/sfi.c
arch/x86/platform/olpc/olpc.c
arch/x86/platform/olpc/olpc_ofw.c
arch/x86/platform/ts5500/ts5500.c
arch/x86/platform/uv/uv_irq.c
arch/x86/platform/uv/uv_nmi.c

index 701fd5843c879fb4529b3f009d0580d55a15e4a9..7ab4d3fc74336dde75a5decb9bff47e7da82e7f7 100644 (file)
@@ -11,7 +11,7 @@
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/irq.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/reboot.h>
 #include <linux/serial_reg.h>
 #include <linux/serial_8250.h>
index b226b3f497f1c75a465fa73f5171a695ea5c9e95..2f984457b9e25343b431305a03276fd0f24593ef 100644 (file)
@@ -24,7 +24,7 @@
 #include <linux/spinlock.h>
 #include <linux/bootmem.h>
 #include <linux/ioport.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/efi.h>
 #include <linux/uaccess.h>
 #include <linux/io.h>
index abbf49c6e9d3525d9188ba7f13ef0bdfa740ff32..ce119d2ba0d00edbe9b065b8773314a5d9814874 100644 (file)
@@ -20,7 +20,7 @@
 #include <linux/scatterlist.h>
 #include <linux/sfi.h>
 #include <linux/irq.h>
-#include <linux/module.h>
+#include <linux/export.h>
 #include <linux/notifier.h>
 
 #include <asm/setup.h>
index 5bc90dd102d43dd955f22c24ca1c64df013f5523..c901a342377233390ee0cd9b255502e1dfdfe67a 100644 (file)
 
 #include <linux/delay.h>
 #include <linux/errno.h>
-#include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/kernel.h>
-#include <linux/module.h>
+#include <linux/export.h>
 #include <linux/mutex.h>
 #include <linux/pci.h>
 
@@ -407,7 +406,6 @@ static const struct pci_device_id mid_pwr_pci_ids[] = {
        { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_TANGIER), (kernel_ulong_t)&mid_info },
        {}
 };
-MODULE_DEVICE_TABLE(pci, mid_pwr_pci_ids);
 
 static struct pci_driver mid_pwr_pci_driver = {
        .name           = "intel_mid_pwr",
index 1555672d436f364d9133d46508cee68c11e222ed..051d264fce2e607c9841303f6bed94b27b920b85 100644 (file)
@@ -24,7 +24,7 @@
 #include <linux/input.h>
 #include <linux/platform_device.h>
 #include <linux/irq.h>
-#include <linux/module.h>
+#include <linux/export.h>
 #include <linux/notifier.h>
 #include <linux/mmc/core.h>
 #include <linux/mmc/card.h>
index 27376081ddec9131a49cf15512f8344c05cae109..7c3077e58fa02f340e21f901ea0315716574ac62 100644 (file)
@@ -12,7 +12,7 @@
 
 #include <linux/kernel.h>
 #include <linux/init.h>
-#include <linux/module.h>
+#include <linux/export.h>
 #include <linux/delay.h>
 #include <linux/io.h>
 #include <linux/string.h>
index e7604f62870d7eb229248ace28624630cb57cfce..f1aab8cdb33f7997ee83423e11a22ecb8943aadd 100644 (file)
@@ -1,9 +1,12 @@
 #include <linux/kernel.h>
-#include <linux/module.h>
+#include <linux/export.h>
+#include <linux/spinlock_types.h>
 #include <linux/init.h>
 #include <asm/page.h>
 #include <asm/setup.h>
 #include <asm/io.h>
+#include <asm/cpufeature.h>
+#include <asm/special_insns.h>
 #include <asm/pgtable.h>
 #include <asm/olpc_ofw.h>
 
index baf16e72e66801342a07bf48ba392e15d8c19873..952191bea75c586972c56eef1b48b488fe045cf1 100644 (file)
@@ -23,7 +23,7 @@
 #include <linux/io.h>
 #include <linux/kernel.h>
 #include <linux/leds.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/platform_data/gpio-ts5500.h>
 #include <linux/platform_data/max197.h>
 #include <linux/platform_device.h>
index e1c24631afbbc943401f35c611ca28b9a3f53c4c..776c6592136cd96e7d667ec6beb37d0944523684 100644 (file)
@@ -8,7 +8,7 @@
  * Copyright (C) 2008 Silicon Graphics, Inc. All rights reserved.
  */
 
-#include <linux/module.h>
+#include <linux/export.h>
 #include <linux/rbtree.h>
 #include <linux/slab.h>
 #include <linux/irq.h>
index 8dd80050d705eea6099212724f953de8364355ff..cd5173a2733f51a8d091334a86027aeda3ef9776 100644 (file)
@@ -24,7 +24,7 @@
 #include <linux/kdb.h>
 #include <linux/kexec.h>
 #include <linux/kgdb.h>
-#include <linux/module.h>
+#include <linux/moduleparam.h>
 #include <linux/nmi.h>
 #include <linux/sched.h>
 #include <linux/slab.h>