Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+74 -63
+1 -1
lib/argv_split.c
··· 6 6 #include <linux/ctype.h> 7 7 #include <linux/string.h> 8 8 #include <linux/slab.h> 9 - #include <linux/module.h> 9 + #include <linux/export.h> 10 10 11 11 static const char *skip_arg(const char *cp) 12 12 {
+1 -1
lib/atomic64.c
··· 13 13 #include <linux/cache.h> 14 14 #include <linux/spinlock.h> 15 15 #include <linux/init.h> 16 - #include <linux/module.h> 16 + #include <linux/export.h> 17 17 #include <linux/atomic.h> 18 18 19 19 /*
+2 -1
lib/average.c
··· 5 5 * Version 2. See the file COPYING for more details. 6 6 */ 7 7 8 - #include <linux/module.h> 8 + #include <linux/export.h> 9 9 #include <linux/average.h> 10 + #include <linux/kernel.h> 10 11 #include <linux/bug.h> 11 12 #include <linux/log2.h> 12 13
+1 -1
lib/bcd.c
··· 1 1 #include <linux/bcd.h> 2 - #include <linux/module.h> 2 + #include <linux/export.h> 3 3 4 4 unsigned bcd2bin(unsigned char val) 5 5 {
+2 -1
lib/bitmap.c
··· 5 5 * This source code is licensed under the GNU General Public License, 6 6 * Version 2. See the file COPYING for more details. 7 7 */ 8 - #include <linux/module.h> 8 + #include <linux/export.h> 9 + #include <linux/thread_info.h> 9 10 #include <linux/ctype.h> 10 11 #include <linux/errno.h> 11 12 #include <linux/bitmap.h>
+1 -1
lib/bsearch.c
··· 9 9 * published by the Free Software Foundation; version 2. 10 10 */ 11 11 12 - #include <linux/module.h> 12 + #include <linux/export.h> 13 13 #include <linux/bsearch.h> 14 14 15 15 /*
+1 -1
lib/check_signature.c
··· 1 1 #include <linux/io.h> 2 - #include <linux/module.h> 2 + #include <linux/export.h> 3 3 4 4 /** 5 5 * check_signature - find BIOS signatures
+1 -1
lib/checksum.c
··· 32 32 /* Revised by Kenneth Albanowski for m68knommu. Basic problem: unaligned access 33 33 kills, so most of the assembly has to go. */ 34 34 35 - #include <linux/module.h> 35 + #include <linux/export.h> 36 36 #include <net/checksum.h> 37 37 38 38 #include <asm/byteorder.h>
+1 -1
lib/cmdline.c
··· 12 12 * 13 13 */ 14 14 15 - #include <linux/module.h> 15 + #include <linux/export.h> 16 16 #include <linux/kernel.h> 17 17 #include <linux/string.h> 18 18
+1 -1
lib/cpu_rmap.c
··· 11 11 #ifdef CONFIG_GENERIC_HARDIRQS 12 12 #include <linux/interrupt.h> 13 13 #endif 14 - #include <linux/module.h> 14 + #include <linux/export.h> 15 15 16 16 /* 17 17 * These functions maintain a mapping from CPUs to some ordered set of
+1 -1
lib/cpumask.c
··· 2 2 #include <linux/kernel.h> 3 3 #include <linux/bitops.h> 4 4 #include <linux/cpumask.h> 5 - #include <linux/module.h> 5 + #include <linux/export.h> 6 6 #include <linux/bootmem.h> 7 7 8 8 int __first_cpu(const cpumask_t *srcp)
+2 -1
lib/ctype.c
··· 5 5 */ 6 6 7 7 #include <linux/ctype.h> 8 - #include <linux/module.h> 8 + #include <linux/compiler.h> 9 + #include <linux/export.h> 9 10 10 11 const unsigned char _ctype[] = { 11 12 _C,_C,_C,_C,_C,_C,_C,_C, /* 0-7 */
+1 -1
lib/debug_locks.c
··· 10 10 */ 11 11 #include <linux/rwsem.h> 12 12 #include <linux/mutex.h> 13 - #include <linux/module.h> 13 + #include <linux/export.h> 14 14 #include <linux/spinlock.h> 15 15 #include <linux/debug_locks.h> 16 16
+1 -1
lib/dec_and_lock.c
··· 1 - #include <linux/module.h> 1 + #include <linux/export.h> 2 2 #include <linux/spinlock.h> 3 3 #include <linux/atomic.h> 4 4
+1 -1
lib/devres.c
··· 1 1 #include <linux/pci.h> 2 2 #include <linux/io.h> 3 3 #include <linux/gfp.h> 4 - #include <linux/module.h> 4 + #include <linux/export.h> 5 5 6 6 void devm_ioremap_release(struct device *dev, void *res) 7 7 {
+2 -1
lib/div64.c
··· 16 16 * assembly versions such as arch/ppc/lib/div64.S and arch/sh/lib/div64.S. 17 17 */ 18 18 19 - #include <linux/module.h> 19 + #include <linux/export.h> 20 + #include <linux/kernel.h> 20 21 #include <linux/math64.h> 21 22 22 23 /* Not needed on 64bit architectures */
+1 -1
lib/dump_stack.c
··· 4 4 */ 5 5 6 6 #include <linux/kernel.h> 7 - #include <linux/module.h> 7 + #include <linux/export.h> 8 8 9 9 void dump_stack(void) 10 10 {
+1 -1
lib/fault-inject.c
··· 5 5 #include <linux/stat.h> 6 6 #include <linux/types.h> 7 7 #include <linux/fs.h> 8 - #include <linux/module.h> 8 + #include <linux/export.h> 9 9 #include <linux/interrupt.h> 10 10 #include <linux/stacktrace.h> 11 11 #include <linux/fault-inject.h>
+1 -1
lib/find_last_bit.c
··· 11 11 */ 12 12 13 13 #include <linux/bitops.h> 14 - #include <linux/module.h> 14 + #include <linux/export.h> 15 15 #include <asm/types.h> 16 16 #include <asm/byteorder.h> 17 17
+1 -1
lib/find_next_bit.c
··· 10 10 */ 11 11 12 12 #include <linux/bitops.h> 13 - #include <linux/module.h> 13 + #include <linux/export.h> 14 14 #include <asm/types.h> 15 15 #include <asm/byteorder.h> 16 16
+1 -1
lib/flex_array.c
··· 23 23 #include <linux/flex_array.h> 24 24 #include <linux/slab.h> 25 25 #include <linux/stddef.h> 26 - #include <linux/module.h> 26 + #include <linux/export.h> 27 27 #include <linux/reciprocal_div.h> 28 28 29 29 struct flex_array_part {
+1 -1
lib/gcd.c
··· 1 1 #include <linux/kernel.h> 2 2 #include <linux/gcd.h> 3 - #include <linux/module.h> 3 + #include <linux/export.h> 4 4 5 5 /* Greatest common divisor */ 6 6 unsigned long gcd(unsigned long a, unsigned long b)
+1 -1
lib/genalloc.c
··· 29 29 */ 30 30 31 31 #include <linux/slab.h> 32 - #include <linux/module.h> 32 + #include <linux/export.h> 33 33 #include <linux/bitmap.h> 34 34 #include <linux/rculist.h> 35 35 #include <linux/interrupt.h>
+1 -1
lib/halfmd4.c
··· 1 1 #include <linux/kernel.h> 2 - #include <linux/module.h> 2 + #include <linux/export.h> 3 3 #include <linux/cryptohash.h> 4 4 5 5 /* F, G and H are basic MD4 functions: selection, majority, parity */
+1 -1
lib/hexdump.c
··· 10 10 #include <linux/types.h> 11 11 #include <linux/ctype.h> 12 12 #include <linux/kernel.h> 13 - #include <linux/module.h> 13 + #include <linux/export.h> 14 14 15 15 const char hex_asc[] = "0123456789abcdef"; 16 16 EXPORT_SYMBOL(hex_asc);
+1 -1
lib/hweight.c
··· 1 - #include <linux/module.h> 1 + #include <linux/export.h> 2 2 #include <linux/bitops.h> 3 3 #include <asm/types.h> 4 4
+1 -1
lib/idr.c
··· 29 29 #ifndef TEST // to test in user space... 30 30 #include <linux/slab.h> 31 31 #include <linux/init.h> 32 - #include <linux/module.h> 32 + #include <linux/export.h> 33 33 #endif 34 34 #include <linux/err.h> 35 35 #include <linux/string.h>
+1 -1
lib/int_sqrt.c
··· 1 1 2 2 #include <linux/kernel.h> 3 - #include <linux/module.h> 3 + #include <linux/export.h> 4 4 5 5 /** 6 6 * int_sqrt - rough approximation to sqrt
+1 -1
lib/iomap.c
··· 6 6 #include <linux/pci.h> 7 7 #include <linux/io.h> 8 8 9 - #include <linux/module.h> 9 + #include <linux/export.h> 10 10 11 11 /* 12 12 * Read/write from/to an (offsettable) iomem cookie. It might be a PIO
+1 -1
lib/iomap_copy.c
··· 15 15 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 16 16 */ 17 17 18 - #include <linux/module.h> 18 + #include <linux/export.h> 19 19 #include <linux/io.h> 20 20 21 21 /**
+1 -1
lib/iommu-helper.c
··· 2 2 * IOMMU helper functions for the free area management 3 3 */ 4 4 5 - #include <linux/module.h> 5 + #include <linux/export.h> 6 6 #include <linux/bitmap.h> 7 7 8 8 int iommu_is_span_boundary(unsigned int index, unsigned int nr,
+1 -1
lib/ioremap.c
··· 9 9 #include <linux/mm.h> 10 10 #include <linux/sched.h> 11 11 #include <linux/io.h> 12 - #include <linux/module.h> 12 + #include <linux/export.h> 13 13 #include <asm/cacheflush.h> 14 14 #include <asm/pgtable.h> 15 15
+2 -1
lib/irq_regs.c
··· 8 8 * as published by the Free Software Foundation; either version 9 9 * 2 of the License, or (at your option) any later version. 10 10 */ 11 - #include <linux/module.h> 11 + #include <linux/export.h> 12 + #include <linux/percpu.h> 12 13 #include <asm/irq_regs.h> 13 14 14 15 #ifndef ARCH_HAS_OWN_IRQ_REGS
+1 -1
lib/kasprintf.c
··· 5 5 */ 6 6 7 7 #include <stdarg.h> 8 - #include <linux/module.h> 8 + #include <linux/export.h> 9 9 #include <linux/slab.h> 10 10 #include <linux/types.h> 11 11 #include <linux/string.h>
+1 -1
lib/klist.c
··· 35 35 */ 36 36 37 37 #include <linux/klist.h> 38 - #include <linux/module.h> 38 + #include <linux/export.h> 39 39 #include <linux/sched.h> 40 40 41 41 /*
+1 -1
lib/kobject.c
··· 14 14 15 15 #include <linux/kobject.h> 16 16 #include <linux/string.h> 17 - #include <linux/module.h> 17 + #include <linux/export.h> 18 18 #include <linux/stat.h> 19 19 #include <linux/slab.h> 20 20
+2 -1
lib/kobject_uevent.c
··· 17 17 #include <linux/spinlock.h> 18 18 #include <linux/string.h> 19 19 #include <linux/kobject.h> 20 - #include <linux/module.h> 20 + #include <linux/export.h> 21 + #include <linux/kmod.h> 21 22 #include <linux/slab.h> 22 23 #include <linux/user_namespace.h> 23 24 #include <linux/socket.h>
+1 -1
lib/kstrtox.c
··· 15 15 #include <linux/errno.h> 16 16 #include <linux/kernel.h> 17 17 #include <linux/math64.h> 18 - #include <linux/module.h> 18 + #include <linux/export.h> 19 19 #include <linux/types.h> 20 20 #include <asm/uaccess.h> 21 21 #include "kstrtox.h"
+1 -1
lib/lcm.c
··· 1 1 #include <linux/kernel.h> 2 2 #include <linux/gcd.h> 3 - #include <linux/module.h> 3 + #include <linux/export.h> 4 4 #include <linux/lcm.h> 5 5 6 6 /* Lowest common multiple */
+2 -1
lib/list_debug.c
··· 6 6 * DEBUG_LIST. 7 7 */ 8 8 9 - #include <linux/module.h> 9 + #include <linux/export.h> 10 10 #include <linux/list.h> 11 + #include <linux/kernel.h> 11 12 12 13 /* 13 14 * Insert a new entry between two known consecutive entries.
+1 -1
lib/llist.c
··· 23 23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 24 */ 25 25 #include <linux/kernel.h> 26 - #include <linux/module.h> 26 + #include <linux/export.h> 27 27 #include <linux/interrupt.h> 28 28 #include <linux/llist.h> 29 29
-1
lib/locking-selftest.c
··· 14 14 #include <linux/mutex.h> 15 15 #include <linux/sched.h> 16 16 #include <linux/delay.h> 17 - #include <linux/module.h> 18 17 #include <linux/lockdep.h> 19 18 #include <linux/spinlock.h> 20 19 #include <linux/kallsyms.h>
+1 -1
lib/md5.c
··· 1 1 #include <linux/kernel.h> 2 - #include <linux/module.h> 2 + #include <linux/export.h> 3 3 #include <linux/cryptohash.h> 4 4 5 5 #define F1(x, y, z) (z ^ (x & (y ^ z)))
+1 -1
lib/nlattr.c
··· 5 5 * Alexey Kuznetsov <kuznet@ms2.inr.ac.ru> 6 6 */ 7 7 8 - #include <linux/module.h> 8 + #include <linux/export.h> 9 9 #include <linux/kernel.h> 10 10 #include <linux/errno.h> 11 11 #include <linux/jiffies.h>
+2 -1
lib/parser.c
··· 6 6 */ 7 7 8 8 #include <linux/ctype.h> 9 - #include <linux/module.h> 9 + #include <linux/types.h> 10 + #include <linux/export.h> 10 11 #include <linux/parser.h> 11 12 #include <linux/slab.h> 12 13 #include <linux/string.h>
+1 -1
lib/radix-tree.c
··· 22 22 #include <linux/errno.h> 23 23 #include <linux/init.h> 24 24 #include <linux/kernel.h> 25 - #include <linux/module.h> 25 + #include <linux/export.h> 26 26 #include <linux/radix-tree.h> 27 27 #include <linux/percpu.h> 28 28 #include <linux/slab.h>
+1 -1
lib/random32.c
··· 35 35 36 36 #include <linux/types.h> 37 37 #include <linux/percpu.h> 38 - #include <linux/module.h> 38 + #include <linux/export.h> 39 39 #include <linux/jiffies.h> 40 40 #include <linux/random.h> 41 41
+1 -1
lib/ratelimit.c
··· 11 11 12 12 #include <linux/ratelimit.h> 13 13 #include <linux/jiffies.h> 14 - #include <linux/module.h> 14 + #include <linux/export.h> 15 15 16 16 /* 17 17 * __ratelimit - rate limiting
+2 -1
lib/rational.c
··· 7 7 */ 8 8 9 9 #include <linux/rational.h> 10 - #include <linux/module.h> 10 + #include <linux/compiler.h> 11 + #include <linux/export.h> 11 12 12 13 /* 13 14 * calculate best rational approximation for a given fraction
+1 -1
lib/rbtree.c
··· 21 21 */ 22 22 23 23 #include <linux/rbtree.h> 24 - #include <linux/module.h> 24 + #include <linux/export.h> 25 25 26 26 static void __rb_rotate_left(struct rb_node *node, struct rb_root *root) 27 27 {
+1 -1
lib/rwsem-spinlock.c
··· 7 7 */ 8 8 #include <linux/rwsem.h> 9 9 #include <linux/sched.h> 10 - #include <linux/module.h> 10 + #include <linux/export.h> 11 11 12 12 struct rwsem_waiter { 13 13 struct list_head list;
+1 -1
lib/rwsem.c
··· 6 6 #include <linux/rwsem.h> 7 7 #include <linux/sched.h> 8 8 #include <linux/init.h> 9 - #include <linux/module.h> 9 + #include <linux/export.h> 10 10 11 11 /* 12 12 * Initialize an rwsem:
+1 -1
lib/scatterlist.c
··· 6 6 * This source code is licensed under the GNU General Public License, 7 7 * Version 2. See the file COPYING for more details. 8 8 */ 9 - #include <linux/module.h> 9 + #include <linux/export.h> 10 10 #include <linux/slab.h> 11 11 #include <linux/scatterlist.h> 12 12 #include <linux/highmem.h>
+1 -1
lib/sha1.c
··· 6 6 */ 7 7 8 8 #include <linux/kernel.h> 9 - #include <linux/module.h> 9 + #include <linux/export.h> 10 10 #include <linux/bitops.h> 11 11 #include <linux/cryptohash.h> 12 12 #include <asm/unaligned.h>
+1 -1
lib/smp_processor_id.c
··· 3 3 * 4 4 * DEBUG_PREEMPT variant of smp_processor_id(). 5 5 */ 6 - #include <linux/module.h> 6 + #include <linux/export.h> 7 7 #include <linux/kallsyms.h> 8 8 #include <linux/sched.h> 9 9
+1 -1
lib/spinlock_debug.c
··· 11 11 #include <linux/interrupt.h> 12 12 #include <linux/debug_locks.h> 13 13 #include <linux/delay.h> 14 - #include <linux/module.h> 14 + #include <linux/export.h> 15 15 16 16 void __raw_spin_lock_init(raw_spinlock_t *lock, const char *name, 17 17 struct lock_class_key *key)
+4 -1
lib/string.c
··· 22 22 #include <linux/types.h> 23 23 #include <linux/string.h> 24 24 #include <linux/ctype.h> 25 - #include <linux/module.h> 25 + #include <linux/kernel.h> 26 + #include <linux/export.h> 27 + #include <linux/bug.h> 28 + #include <linux/errno.h> 26 29 27 30 #ifndef __HAVE_ARCH_STRNICMP 28 31 /**
+1 -1
lib/string_helpers.c
··· 5 5 */ 6 6 #include <linux/kernel.h> 7 7 #include <linux/math64.h> 8 - #include <linux/module.h> 8 + #include <linux/export.h> 9 9 #include <linux/string_helpers.h> 10 10 11 11 /**
+1 -1
lib/swiotlb.c
··· 20 20 #include <linux/cache.h> 21 21 #include <linux/dma-mapping.h> 22 22 #include <linux/mm.h> 23 - #include <linux/module.h> 23 + #include <linux/export.h> 24 24 #include <linux/spinlock.h> 25 25 #include <linux/string.h> 26 26 #include <linux/swiotlb.h>
+1 -1
lib/syscall.c
··· 1 1 #include <linux/ptrace.h> 2 2 #include <linux/sched.h> 3 - #include <linux/module.h> 3 + #include <linux/export.h> 4 4 #include <asm/syscall.h> 5 5 6 6 static int collect_syscall(struct task_struct *target, long *callno,
+1 -1
lib/timerqueue.c
··· 24 24 25 25 #include <linux/timerqueue.h> 26 26 #include <linux/rbtree.h> 27 - #include <linux/module.h> 27 + #include <linux/export.h> 28 28 29 29 /** 30 30 * timerqueue_add - Adds timer to timerqueue.
+1 -1
lib/uuid.c
··· 19 19 */ 20 20 21 21 #include <linux/kernel.h> 22 - #include <linux/module.h> 22 + #include <linux/export.h> 23 23 #include <linux/uuid.h> 24 24 #include <linux/random.h> 25 25
+1 -1
lib/vsprintf.c
··· 17 17 */ 18 18 19 19 #include <stdarg.h> 20 - #include <linux/module.h> 20 + #include <linux/module.h> /* for KSYM_SYMBOL_LEN */ 21 21 #include <linux/types.h> 22 22 #include <linux/string.h> 23 23 #include <linux/ctype.h>