x86/lib: 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.  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>
This commit is contained in:
Paul Gortmaker 2016-07-13 20:18:57 -04:00 committed by Ingo Molnar
parent 186f43608a
commit e683014c21
14 changed files with 16 additions and 14 deletions

View File

@ -1,5 +1,5 @@
#include <linux/smp.h> #include <linux/smp.h>
#include <linux/module.h> #include <linux/export.h>
static void __wbinvd(void *dummy) static void __wbinvd(void *dummy)
{ {

View File

@ -1,4 +1,5 @@
#include <linux/module.h> #include <linux/types.h>
#include <linux/export.h>
unsigned int x86_family(unsigned int sig) unsigned int x86_family(unsigned int sig)
{ {

View File

@ -6,7 +6,7 @@
*/ */
#include <linux/compiler.h> #include <linux/compiler.h>
#include <linux/module.h> #include <linux/export.h>
#include <asm/checksum.h> #include <asm/checksum.h>
static inline unsigned short from32to16(unsigned a) static inline unsigned short from32to16(unsigned a)

View File

@ -5,7 +5,7 @@
* Wrappers of assembly checksum functions for x86-64. * Wrappers of assembly checksum functions for x86-64.
*/ */
#include <asm/checksum.h> #include <asm/checksum.h>
#include <linux/module.h> #include <linux/export.h>
#include <asm/smap.h> #include <asm/smap.h>
/** /**

View File

@ -11,7 +11,7 @@
* we have to worry about. * we have to worry about.
*/ */
#include <linux/module.h> #include <linux/export.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/timex.h> #include <linux/timex.h>
#include <linux/preempt.h> #include <linux/preempt.h>

View File

@ -1,5 +1,5 @@
#include <linux/string.h> #include <linux/string.h>
#include <linux/module.h> #include <linux/export.h>
#undef memcpy #undef memcpy
#undef memset #undef memset

View File

@ -18,7 +18,7 @@
*/ */
#include <linux/hardirq.h> #include <linux/hardirq.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/module.h> #include <linux/export.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/types.h> #include <linux/types.h>

View File

@ -1,4 +1,4 @@
#include <linux/module.h> #include <linux/export.h>
#include <asm/msr.h> #include <asm/msr.h>
EXPORT_SYMBOL(rdmsr_safe_regs); EXPORT_SYMBOL(rdmsr_safe_regs);

View File

@ -1,4 +1,4 @@
#include <linux/module.h> #include <linux/export.h>
#include <linux/preempt.h> #include <linux/preempt.h>
#include <linux/smp.h> #include <linux/smp.h>
#include <asm/msr.h> #include <asm/msr.h>

View File

@ -1,4 +1,5 @@
#include <linux/module.h> #include <linux/export.h>
#include <linux/percpu.h>
#include <linux/preempt.h> #include <linux/preempt.h>
#include <asm/msr.h> #include <asm/msr.h>
#define CREATE_TRACE_POINTS #define CREATE_TRACE_POINTS

View File

@ -11,7 +11,7 @@
*/ */
#include <linux/string.h> #include <linux/string.h>
#include <linux/module.h> #include <linux/export.h>
#ifdef __HAVE_ARCH_STRCPY #ifdef __HAVE_ARCH_STRCPY
char *strcpy(char *dest, const char *src) char *strcpy(char *dest, const char *src)

View File

@ -5,7 +5,7 @@
*/ */
#include <linux/highmem.h> #include <linux/highmem.h>
#include <linux/module.h> #include <linux/export.h>
#include <asm/word-at-a-time.h> #include <asm/word-at-a-time.h>
#include <linux/sched.h> #include <linux/sched.h>

View File

@ -8,7 +8,7 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/highmem.h> #include <linux/highmem.h>
#include <linux/blkdev.h> #include <linux/blkdev.h>
#include <linux/module.h> #include <linux/export.h>
#include <linux/backing-dev.h> #include <linux/backing-dev.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>

View File

@ -5,7 +5,7 @@
* Copyright 1997 Linus Torvalds * Copyright 1997 Linus Torvalds
* Copyright 2002 Andi Kleen <ak@suse.de> * Copyright 2002 Andi Kleen <ak@suse.de>
*/ */
#include <linux/module.h> #include <linux/export.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
/* /*