]> git.karo-electronics.de Git - linux-beck.git/commitdiff
x86/lib: Audit and remove any unnecessary uses of module.h
authorPaul Gortmaker <paul.gortmaker@windriver.com>
Thu, 14 Jul 2016 00:18:57 +0000 (20:18 -0400)
committerIngo Molnar <mingo@kernel.org>
Thu, 14 Jul 2016 13:06:58 +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.  Build testing
revealed a couple implicit header usage issues that were fixed.

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-5-paul.gortmaker@windriver.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
14 files changed:
arch/x86/lib/cache-smp.c
arch/x86/lib/cpu.c
arch/x86/lib/csum-partial_64.c
arch/x86/lib/csum-wrappers_64.c
arch/x86/lib/delay.c
arch/x86/lib/memcpy_32.c
arch/x86/lib/mmx_32.c
arch/x86/lib/msr-reg-export.c
arch/x86/lib/msr-smp.c
arch/x86/lib/msr.c
arch/x86/lib/string_32.c
arch/x86/lib/usercopy.c
arch/x86/lib/usercopy_32.c
arch/x86/lib/usercopy_64.c

index a3c66887503848cb6a9c5ac628e4bd6d1408eb0b..216a629a4a1a6d4f684b51e224fcd26f169929d4 100644 (file)
@@ -1,5 +1,5 @@
 #include <linux/smp.h>
-#include <linux/module.h>
+#include <linux/export.h>
 
 static void __wbinvd(void *dummy)
 {
index aa417a97511cd4200f9b6a7796cbb32f96bf1e8b..d6f848d1211d4b2deaf193fca80fb4834310dff4 100644 (file)
@@ -1,4 +1,5 @@
-#include <linux/module.h>
+#include <linux/types.h>
+#include <linux/export.h>
 
 unsigned int x86_family(unsigned int sig)
 {
index 9845371c5c36841c9e9711975e2df100dd09ede3..9a7fe6a70491e20c7c648d97d04a2009ac0460b6 100644 (file)
@@ -6,7 +6,7 @@
  */
  
 #include <linux/compiler.h>
-#include <linux/module.h>
+#include <linux/export.h>
 #include <asm/checksum.h>
 
 static inline unsigned short from32to16(unsigned a) 
index 28a6654f0d08e34bb11d81747305fa8fbe67f4fe..f8dc05d0881e115017a453532352587b9187fa6b 100644 (file)
@@ -5,7 +5,7 @@
  * Wrappers of assembly checksum functions for x86-64.
  */
 #include <asm/checksum.h>
-#include <linux/module.h>
+#include <linux/export.h>
 #include <asm/smap.h>
 
 /**
index 2f07c291dcc855af5c483c55133d91a4dff21c92..073d1f1a620bd6797973eaa05338d918c9dd7b54 100644 (file)
@@ -11,7 +11,7 @@
  *     we have to worry about.
  */
 
-#include <linux/module.h>
+#include <linux/export.h>
 #include <linux/sched.h>
 #include <linux/timex.h>
 #include <linux/preempt.h>
index a404b4b7553319cd7d517355bf340784de344562..cad12634d6bd8f5564b71bf7fc33d7354f149a9a 100644 (file)
@@ -1,5 +1,5 @@
 #include <linux/string.h>
-#include <linux/module.h>
+#include <linux/export.h>
 
 #undef memcpy
 #undef memset
index e5e3ed8dc0798bd007e8573ddbf57dc4e2312049..c2311a678332c55798f62377331aa7650cf2021c 100644 (file)
@@ -18,7 +18,7 @@
  */
 #include <linux/hardirq.h>
 #include <linux/string.h>
-#include <linux/module.h>
+#include <linux/export.h>
 #include <linux/sched.h>
 #include <linux/types.h>
 
index 8d6ef78b5d01c3a180959bd54f7da26ddf325188..ff29e8d3941472f02702dd314fb825f54de736ea 100644 (file)
@@ -1,4 +1,4 @@
-#include <linux/module.h>
+#include <linux/export.h>
 #include <asm/msr.h>
 
 EXPORT_SYMBOL(rdmsr_safe_regs);
index 518532e6a3faa213eb0833c6781c9ceba34dea86..ce68b6a9d7d1e68a1db697ed0ee441db5d83f7f0 100644 (file)
@@ -1,4 +1,4 @@
-#include <linux/module.h>
+#include <linux/export.h>
 #include <linux/preempt.h>
 #include <linux/smp.h>
 #include <asm/msr.h>
index 004c861b1648e50ae8c386563b798bb6d50bece7..d1dee753b94944737047d84d69ed0c21c84835d5 100644 (file)
@@ -1,4 +1,5 @@
-#include <linux/module.h>
+#include <linux/export.h>
+#include <linux/percpu.h>
 #include <linux/preempt.h>
 #include <asm/msr.h>
 #define CREATE_TRACE_POINTS
index bd59090825dbabb96821c30c498d18cf2220857a..dc0ad12f80bbca8f847430ded8023e531f5f3d11 100644 (file)
@@ -11,7 +11,7 @@
  */
 
 #include <linux/string.h>
-#include <linux/module.h>
+#include <linux/export.h>
 
 #ifdef __HAVE_ARCH_STRCPY
 char *strcpy(char *dest, const char *src)
index e342586db6e4b08230ce6a596c91e27bb5fcf2db..b4908789484e39870f006afb66e43c95bd6281d3 100644 (file)
@@ -5,7 +5,7 @@
  */
 
 #include <linux/highmem.h>
-#include <linux/module.h>
+#include <linux/export.h>
 
 #include <asm/word-at-a-time.h>
 #include <linux/sched.h>
index b559d923878133aadb4480c61e642bbf6c799086..3bc7baf2a711fa3a88066ee3c3527c441216441b 100644 (file)
@@ -8,7 +8,7 @@
 #include <linux/mm.h>
 #include <linux/highmem.h>
 #include <linux/blkdev.h>
-#include <linux/module.h>
+#include <linux/export.h>
 #include <linux/backing-dev.h>
 #include <linux/interrupt.h>
 #include <asm/uaccess.h>
index 0a42327a59d71e5e2d607623ba209a69d37c6f8d..e1e0364cb9dd34baab7f21f2d97e8e2c773b3cda 100644 (file)
@@ -5,7 +5,7 @@
  * Copyright 1997 Linus Torvalds
  * Copyright 2002 Andi Kleen <ak@suse.de>
  */
-#include <linux/module.h>
+#include <linux/export.h>
 #include <asm/uaccess.h>
 
 /*