History

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.

Paul Gortmaker committed 14 years ago

Commit 8bc3bcc1 parent 630d9c463 files · +74 −63Browse files

Unified · Split

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