lib: reduce the use of module.h wherever possible

For files only using THIS_MODULE and/or EXPORT_SYMBOL, map
them onto including export.h -- or if the file isn't even
using those, then just delete the include.  Fix up any implicit
include dependencies that were being masked by module.h along
the way.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
This commit is contained in:
Paul Gortmaker 2011-11-16 21:29:17 -05:00
parent 630d9c4727
commit 8bc3bcc93a
63 changed files with 74 additions and 63 deletions

View file

@ -6,7 +6,7 @@
#include <linux/ctype.h>
#include <linux/string.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/export.h>
static const char *skip_arg(const char *cp)
{

View file

@ -13,7 +13,7 @@
#include <linux/cache.h>
#include <linux/spinlock.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/export.h>
#include <linux/atomic.h>
/*

View file

@ -5,8 +5,9 @@
* Version 2. See the file COPYING for more details.
*/
#include <linux/module.h>
#include <linux/export.h>
#include <linux/average.h>
#include <linux/kernel.h>
#include <linux/bug.h>
#include <linux/log2.h>

View file

@ -1,5 +1,5 @@
#include <linux/bcd.h>
#include <linux/module.h>
#include <linux/export.h>
unsigned bcd2bin(unsigned char val)
{

View file

@ -5,7 +5,8 @@
* This source code is licensed under the GNU General Public License,
* Version 2. See the file COPYING for more details.
*/
#include <linux/module.h>
#include <linux/export.h>
#include <linux/thread_info.h>
#include <linux/ctype.h>
#include <linux/errno.h>
#include <linux/bitmap.h>

View file

@ -9,7 +9,7 @@
* published by the Free Software Foundation; version 2.
*/
#include <linux/module.h>
#include <linux/export.h>
#include <linux/bsearch.h>
/*

View file

@ -1,5 +1,5 @@
#include <linux/io.h>
#include <linux/module.h>
#include <linux/export.h>
/**
* check_signature - find BIOS signatures

View file

@ -32,7 +32,7 @@
/* Revised by Kenneth Albanowski for m68knommu. Basic problem: unaligned access
kills, so most of the assembly has to go. */
#include <linux/module.h>
#include <linux/export.h>
#include <net/checksum.h>
#include <asm/byteorder.h>

View file

@ -12,7 +12,7 @@
*
*/
#include <linux/module.h>
#include <linux/export.h>
#include <linux/kernel.h>
#include <linux/string.h>

View file

@ -11,7 +11,7 @@
#ifdef CONFIG_GENERIC_HARDIRQS
#include <linux/interrupt.h>
#endif
#include <linux/module.h>
#include <linux/export.h>
/*
* These functions maintain a mapping from CPUs to some ordered set of

View file

@ -2,7 +2,7 @@
#include <linux/kernel.h>
#include <linux/bitops.h>
#include <linux/cpumask.h>
#include <linux/module.h>
#include <linux/export.h>
#include <linux/bootmem.h>
int __first_cpu(const cpumask_t *srcp)

View file

@ -5,7 +5,8 @@
*/
#include <linux/ctype.h>
#include <linux/module.h>
#include <linux/compiler.h>
#include <linux/export.h>
const unsigned char _ctype[] = {
_C,_C,_C,_C,_C,_C,_C,_C, /* 0-7 */

View file

@ -10,7 +10,7 @@
*/
#include <linux/rwsem.h>
#include <linux/mutex.h>
#include <linux/module.h>
#include <linux/export.h>
#include <linux/spinlock.h>
#include <linux/debug_locks.h>

View file

@ -1,4 +1,4 @@
#include <linux/module.h>
#include <linux/export.h>
#include <linux/spinlock.h>
#include <linux/atomic.h>

View file

@ -1,7 +1,7 @@
#include <linux/pci.h>
#include <linux/io.h>
#include <linux/gfp.h>
#include <linux/module.h>
#include <linux/export.h>
void devm_ioremap_release(struct device *dev, void *res)
{

View file

@ -16,7 +16,8 @@
* assembly versions such as arch/ppc/lib/div64.S and arch/sh/lib/div64.S.
*/
#include <linux/module.h>
#include <linux/export.h>
#include <linux/kernel.h>
#include <linux/math64.h>
/* Not needed on 64bit architectures */

View file

@ -4,7 +4,7 @@
*/
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/export.h>
void dump_stack(void)
{

View file

@ -5,7 +5,7 @@
#include <linux/stat.h>
#include <linux/types.h>
#include <linux/fs.h>
#include <linux/module.h>
#include <linux/export.h>
#include <linux/interrupt.h>
#include <linux/stacktrace.h>
#include <linux/fault-inject.h>

View file

@ -11,7 +11,7 @@
*/
#include <linux/bitops.h>
#include <linux/module.h>
#include <linux/export.h>
#include <asm/types.h>
#include <asm/byteorder.h>

View file

@ -10,7 +10,7 @@
*/
#include <linux/bitops.h>
#include <linux/module.h>
#include <linux/export.h>
#include <asm/types.h>
#include <asm/byteorder.h>

View file

@ -23,7 +23,7 @@
#include <linux/flex_array.h>
#include <linux/slab.h>
#include <linux/stddef.h>
#include <linux/module.h>
#include <linux/export.h>
#include <linux/reciprocal_div.h>
struct flex_array_part {

View file

@ -1,6 +1,6 @@
#include <linux/kernel.h>
#include <linux/gcd.h>
#include <linux/module.h>
#include <linux/export.h>
/* Greatest common divisor */
unsigned long gcd(unsigned long a, unsigned long b)

View file

@ -29,7 +29,7 @@
*/
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/export.h>
#include <linux/bitmap.h>
#include <linux/rculist.h>
#include <linux/interrupt.h>

View file

@ -1,5 +1,5 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/export.h>
#include <linux/cryptohash.h>
/* F, G and H are basic MD4 functions: selection, majority, parity */

View file

@ -10,7 +10,7 @@
#include <linux/types.h>
#include <linux/ctype.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/export.h>
const char hex_asc[] = "0123456789abcdef";
EXPORT_SYMBOL(hex_asc);

View file

@ -1,4 +1,4 @@
#include <linux/module.h>
#include <linux/export.h>
#include <linux/bitops.h>
#include <asm/types.h>

View file

@ -29,7 +29,7 @@
#ifndef TEST // to test in user space...
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/export.h>
#endif
#include <linux/err.h>
#include <linux/string.h>

View file

@ -1,6 +1,6 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/export.h>
/**
* int_sqrt - rough approximation to sqrt

View file

@ -6,7 +6,7 @@
#include <linux/pci.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/export.h>
/*
* Read/write from/to an (offsettable) iomem cookie. It might be a PIO

View file

@ -15,7 +15,7 @@
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include <linux/module.h>
#include <linux/export.h>
#include <linux/io.h>
/**

View file

@ -2,7 +2,7 @@
* IOMMU helper functions for the free area management
*/
#include <linux/module.h>
#include <linux/export.h>
#include <linux/bitmap.h>
int iommu_is_span_boundary(unsigned int index, unsigned int nr,

View file

@ -9,7 +9,7 @@
#include <linux/mm.h>
#include <linux/sched.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/export.h>
#include <asm/cacheflush.h>
#include <asm/pgtable.h>

View file

@ -8,7 +8,8 @@
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
#include <linux/module.h>
#include <linux/export.h>
#include <linux/percpu.h>
#include <asm/irq_regs.h>
#ifndef ARCH_HAS_OWN_IRQ_REGS

View file

@ -5,7 +5,7 @@
*/
#include <stdarg.h>
#include <linux/module.h>
#include <linux/export.h>
#include <linux/slab.h>
#include <linux/types.h>
#include <linux/string.h>

View file

@ -35,7 +35,7 @@
*/
#include <linux/klist.h>
#include <linux/module.h>
#include <linux/export.h>
#include <linux/sched.h>
/*

View file

@ -14,7 +14,7 @@
#include <linux/kobject.h>
#include <linux/string.h>
#include <linux/module.h>
#include <linux/export.h>
#include <linux/stat.h>
#include <linux/slab.h>

View file

@ -17,7 +17,8 @@
#include <linux/spinlock.h>
#include <linux/string.h>
#include <linux/kobject.h>
#include <linux/module.h>
#include <linux/export.h>
#include <linux/kmod.h>
#include <linux/slab.h>
#include <linux/user_namespace.h>
#include <linux/socket.h>

View file

@ -15,7 +15,7 @@
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/math64.h>
#include <linux/module.h>
#include <linux/export.h>
#include <linux/types.h>
#include <asm/uaccess.h>
#include "kstrtox.h"

View file

@ -1,6 +1,6 @@
#include <linux/kernel.h>
#include <linux/gcd.h>
#include <linux/module.h>
#include <linux/export.h>
#include <linux/lcm.h>
/* Lowest common multiple */

View file

@ -6,8 +6,9 @@
* DEBUG_LIST.
*/
#include <linux/module.h>
#include <linux/export.h>
#include <linux/list.h>
#include <linux/kernel.h>
/*
* Insert a new entry between two known consecutive entries.

View file

@ -23,7 +23,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/export.h>
#include <linux/interrupt.h>
#include <linux/llist.h>

View file

@ -14,7 +14,6 @@
#include <linux/mutex.h>
#include <linux/sched.h>
#include <linux/delay.h>
#include <linux/module.h>
#include <linux/lockdep.h>
#include <linux/spinlock.h>
#include <linux/kallsyms.h>

View file

@ -1,5 +1,5 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/export.h>
#include <linux/cryptohash.h>
#define F1(x, y, z) (z ^ (x & (y ^ z)))

View file

@ -5,7 +5,7 @@
* Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
*/
#include <linux/module.h>
#include <linux/export.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/jiffies.h>

View file

@ -6,7 +6,8 @@
*/
#include <linux/ctype.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/export.h>
#include <linux/parser.h>
#include <linux/slab.h>
#include <linux/string.h>

View file

@ -22,7 +22,7 @@
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/export.h>
#include <linux/radix-tree.h>
#include <linux/percpu.h>
#include <linux/slab.h>

View file

@ -35,7 +35,7 @@
#include <linux/types.h>
#include <linux/percpu.h>
#include <linux/module.h>
#include <linux/export.h>
#include <linux/jiffies.h>
#include <linux/random.h>

View file

@ -11,7 +11,7 @@
#include <linux/ratelimit.h>
#include <linux/jiffies.h>
#include <linux/module.h>
#include <linux/export.h>
/*
* __ratelimit - rate limiting

View file

@ -7,7 +7,8 @@
*/
#include <linux/rational.h>
#include <linux/module.h>
#include <linux/compiler.h>
#include <linux/export.h>
/*
* calculate best rational approximation for a given fraction

View file

@ -21,7 +21,7 @@
*/
#include <linux/rbtree.h>
#include <linux/module.h>
#include <linux/export.h>
static void __rb_rotate_left(struct rb_node *node, struct rb_root *root)
{

View file

@ -7,7 +7,7 @@
*/
#include <linux/rwsem.h>
#include <linux/sched.h>
#include <linux/module.h>
#include <linux/export.h>
struct rwsem_waiter {
struct list_head list;

View file

@ -6,7 +6,7 @@
#include <linux/rwsem.h>
#include <linux/sched.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/export.h>
/*
* Initialize an rwsem:

View file

@ -6,7 +6,7 @@
* This source code is licensed under the GNU General Public License,
* Version 2. See the file COPYING for more details.
*/
#include <linux/module.h>
#include <linux/export.h>
#include <linux/slab.h>
#include <linux/scatterlist.h>
#include <linux/highmem.h>

View file

@ -6,7 +6,7 @@
*/
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/export.h>
#include <linux/bitops.h>
#include <linux/cryptohash.h>
#include <asm/unaligned.h>

View file

@ -3,7 +3,7 @@
*
* DEBUG_PREEMPT variant of smp_processor_id().
*/
#include <linux/module.h>
#include <linux/export.h>
#include <linux/kallsyms.h>
#include <linux/sched.h>

View file

@ -11,7 +11,7 @@
#include <linux/interrupt.h>
#include <linux/debug_locks.h>
#include <linux/delay.h>
#include <linux/module.h>
#include <linux/export.h>
void __raw_spin_lock_init(raw_spinlock_t *lock, const char *name,
struct lock_class_key *key)

View file

@ -22,7 +22,10 @@
#include <linux/types.h>
#include <linux/string.h>
#include <linux/ctype.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/export.h>
#include <linux/bug.h>
#include <linux/errno.h>
#ifndef __HAVE_ARCH_STRNICMP
/**

View file

@ -5,7 +5,7 @@
*/
#include <linux/kernel.h>
#include <linux/math64.h>
#include <linux/module.h>
#include <linux/export.h>
#include <linux/string_helpers.h>
/**

View file

@ -20,7 +20,7 @@
#include <linux/cache.h>
#include <linux/dma-mapping.h>
#include <linux/mm.h>
#include <linux/module.h>
#include <linux/export.h>
#include <linux/spinlock.h>
#include <linux/string.h>
#include <linux/swiotlb.h>

View file

@ -1,6 +1,6 @@
#include <linux/ptrace.h>
#include <linux/sched.h>
#include <linux/module.h>
#include <linux/export.h>
#include <asm/syscall.h>
static int collect_syscall(struct task_struct *target, long *callno,

View file

@ -24,7 +24,7 @@
#include <linux/timerqueue.h>
#include <linux/rbtree.h>
#include <linux/module.h>
#include <linux/export.h>
/**
* timerqueue_add - Adds timer to timerqueue.

View file

@ -19,7 +19,7 @@
*/
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/export.h>
#include <linux/uuid.h>
#include <linux/random.h>

View file

@ -17,7 +17,7 @@
*/
#include <stdarg.h>
#include <linux/module.h>
#include <linux/module.h> /* for KSYM_SYMBOL_LEN */
#include <linux/types.h>
#include <linux/string.h>
#include <linux/ctype.h>