History

Merge branch 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux

* 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux: (230 commits) Revert "tracing: Include module.h in define_trace.h" irq: don't put module.h into irq.h for tracking irqgen modules. bluetooth: macroize two small inlines to avoid module.h ip_vs.h: fix implicit use of module_get/module_put from module.h nf_conntrack.h: fix up fallout from implicit moduleparam.h presence include: replace linux/module.h with "struct module" wherever possible include: convert various register fcns to macros to avoid include chaining crypto.h: remove unused crypto_tfm_alg_modname() inline uwb.h: fix implicit use of asm/page.h for PAGE_SIZE pm_runtime.h: explicitly requires notifier.h linux/dmaengine.h: fix implicit use of bitmap.h and asm/page.h miscdevice.h: fix up implicit use of lists and types stop_machine.h: fix implicit use of smp.h for smp_processor_id of: fix implicit use of errno.h in include/linux/of.h of_platform.h: delete needless include <linux/module.h> acpi: remove module.h include from platform/aclinux.h miscdevice.h: delete unnecessary inclusion of module.h device_cgroup.h: delete needless include <linux/module.h> net: sch_generic remove redundant use of <linux/module.h> net: inet_timewait_sock doesnt need <linux/module.h> ... Fix up trivial conflicts (other header files, and removal of the ab3550 mfd driver) in - drivers/media/dvb/frontends/dibx000_common.c - drivers/media/video/{mt9m111.c,ov6650.c} - drivers/mfd/ab3550-core.c - include/linux/dmaengine.h

Linus Torvalds committed 15 years ago

Commit 32aaeff2 parents 208bca0 67b84992057 files · +2248 −606Browse files

Showing the changes to include (55 of 2057 files). Show all

Unified · Split

55 files
  1. include/acpi/platform/aclinux.h +0 −1
  2. include/drm/drmP.h +2 −1
  3. include/linux/bcma/bcma.h +3 −4
  4. include/linux/blkdev.h +1 −1
  5. include/linux/cpuidle.h +2 −1
  6. include/linux/crypto.h +0 −6
  7. include/linux/device.h +10 −5
  8. include/linux/device_cgroup.h +0 −1
  9. include/linux/dmaengine.h +2 −0
  10. include/linux/export.h +89 −0
  11. include/linux/firmware.h +1 −1
  12. include/linux/ftrace.h +1 −1
  13. include/linux/gameport.h +8 −9
  14. include/linux/hid.h +5 −4
  15. include/linux/i2c.h +5 −5
  16. include/linux/ipmi.h +2 −1
  17. include/linux/ipmi_smi.h +0 −1
  18. include/linux/irq.h +12 −20
  19. include/linux/irqdesc.h +1 −0
  20. include/linux/mdio-bitbang.h +2 −1
  21. include/linux/miscdevice.h +2 −1
  22. include/linux/module.h +1 −72
  23. include/linux/moduleparam.h +5 −0
  24. include/linux/mtd/mtd.h +2 −1
  25. include/linux/of.h +1 −0
  26. include/linux/of_platform.h +0 −1
  27. include/linux/pci_hotplug.h +3 −7
  28. include/linux/pm_runtime.h +1 −0
  29. include/linux/regmap.h +1 −1
  30. include/linux/regulator/driver.h +1 −0
  31. include/linux/serio.h +11 −9
  32. include/linux/ssb/ssb.h +3 −4
  33. include/linux/stop_machine.h +1 −0
  34. include/linux/sunrpc/svc_xprt.h +2 −1
  35. include/linux/sysdev.h +0 −1
  36. include/linux/textsearch.h +2 −1
  37. include/linux/uio_driver.h +6 −6
  38. include/linux/usb.h +5 −4
  39. include/linux/uwb.h +1 −0
  40. include/linux/uwb/umc.h +3 −4
  41. include/linux/vermagic.h +0 −1
  42. include/linux/vlynq.h +2 −1
  43. include/media/saa7146.h +2 −1
  44. include/media/v4l2-int-device.h +2 −1
  45. include/net/bluetooth/hci_core.h +13 −11
  46. include/net/inet_timewait_sock.h +0 −1
  47. include/net/ip_vs.h +7 −8
  48. include/net/lib80211.h +2 −1
  49. include/net/netfilter/nf_conntrack.h +2 −0
  50. include/net/sch_generic.h +0 −1
  51. include/net/sock.h +1 −1
  52. include/sound/core.h +1 −1
  53. include/trace/define_trace.h +0 −10
  54. include/trace/events/module.h +1 −1
  55. include/xen/xenbus.h +1 −0
include/acpi/platform/aclinux.h+0−1
@@ -55,7 +55,6 @@ · 54 unmodified lines
5555
5656 #include <linux/string.h>
5757 #include <linux/kernel.h>
58−#include <linux/module.h>
5958 #include <linux/ctype.h>
6059 #include <linux/sched.h>
6160 #include <asm/system.h>
include/drm/drmP.h+2−1
@@ -42,7 +42,6 @@ · 41 unmodified lines
4242 * can build the DRM (part of PI DRI). 4/21/2000 S + B */
4343 #include <asm/current.h>
4444 #endif /* __alpha__ */
45−#include <linux/module.h>
4645 #include <linux/kernel.h>
4746 #include <linux/miscdevice.h>
4847 #include <linux/fs.h>
@@ -80,6 +79,8 @@ · 31 unmodified lines
8079 #define __OS_HAS_AGP (defined(CONFIG_AGP) || (defined(CONFIG_AGP_MODULE) && defined(MODULE)))
8180 #define __OS_HAS_MTRR (defined(CONFIG_MTRR))
8281
82+struct module;
83+
8384 struct drm_file;
8485 struct drm_device;
8586
include/linux/bcma/bcma.h+3−4
@@ -170,10 +170,9 @@ struct bcma_driver { · 169 unmodified lines
170170 };
171171 extern
172172 int __bcma_driver_register(struct bcma_driver *drv, struct module *owner);
173−static inline int bcma_driver_register(struct bcma_driver *drv)
174−{
175− return __bcma_driver_register(drv, THIS_MODULE);
176−}
173+#define bcma_driver_register(drv) \
174+ __bcma_driver_register(drv, THIS_MODULE)
175+
177176 extern void bcma_driver_unregister(struct bcma_driver *drv);
178177
179178 struct bcma_bus {
include/linux/blkdev.h+1−1
@@ -14,7 +14,6 @@ · 13 unmodified lines
1414 #include <linux/wait.h>
1515 #include <linux/mempool.h>
1616 #include <linux/bio.h>
17−#include <linux/module.h>
1817 #include <linux/stringify.h>
1918 #include <linux/gfp.h>
2019 #include <linux/bsg.h>
@@ -22,6 +21,7 @@ · 1 unmodified line
2221
2322 #include <asm/scatterlist.h>
2423
24+struct module;
2525 struct scsi_ioctl_command;
2626
2727 struct request_queue;
include/linux/cpuidle.h+2−1
@@ -13,7 +13,6 @@ · 12 unmodified lines
1313
1414 #include <linux/percpu.h>
1515 #include <linux/list.h>
16−#include <linux/module.h>
1716 #include <linux/kobject.h>
1817 #include <linux/completion.h>
1918
@@ -21,6 +20,8 @@ · 1 unmodified line
2120 #define CPUIDLE_NAME_LEN 16
2221 #define CPUIDLE_DESC_LEN 32
2322
23+struct module;
24+
2425 struct cpuidle_device;
2526
2627
include/linux/crypto.h+0−6
@@ -18,7 +18,6 @@ · 17 unmodified lines
1818 #define _LINUX_CRYPTO_H
1919
2020 #include <linux/atomic.h>
21−#include <linux/module.h>
2221 #include <linux/kernel.h>
2322 #include <linux/list.h>
2423 #include <linux/slab.h>
@@ -510,11 +509,6 @@ static inline int crypto_tfm_alg_priority(struct crypto_tfm *tfm) · 485 unmodified lines
510509 return tfm->__crt_alg->cra_priority;
511510 }
512511
513−static inline const char *crypto_tfm_alg_modname(struct crypto_tfm *tfm)
514−{
515− return module_name(tfm->__crt_alg->cra_module);
516−}
517−
518512 static inline u32 crypto_tfm_alg_type(struct crypto_tfm *tfm)
519513 {
520514 return tfm->__crt_alg->cra_flags & CRYPTO_ALG_TYPE_MASK;
include/linux/device.h+10−5
@@ -20,7 +20,7 @@ · 19 unmodified lines
2020 #include <linux/lockdep.h>
2121 #include <linux/compiler.h>
2222 #include <linux/types.h>
23−#include <linux/module.h>
23+#include <linux/mutex.h>
2424 #include <linux/pm.h>
2525 #include <linux/atomic.h>
2626 #include <asm/device.h>
@@ -29,6 +29,7 @@ struct device; · 2 unmodified lines
2929 struct device_private;
3030 struct device_driver;
3131 struct driver_private;
32+struct module;
3233 struct class;
3334 struct subsys_private;
3435 struct bus_type;
@@ -723,10 +724,14 @@ extern int dev_set_drvdata(struct device *dev, void *data); · 688 unmodified lines
723724 */
724725 extern struct device *__root_device_register(const char *name,
725726 struct module *owner);
726−static inline struct device *root_device_register(const char *name)
727−{
728− return __root_device_register(name, THIS_MODULE);
729−}
727+
728+/*
729+ * This is a macro to avoid include problems with THIS_MODULE,
730+ * just as per what is done for device_schedule_callback() above.
731+ */
732+#define root_device_register(name) \
733+ __root_device_register(name, THIS_MODULE)
734+
730735 extern void root_device_unregister(struct device *root);
731736
732737 static inline void *dev_get_platdata(const struct device *dev)
include/linux/device_cgroup.h+0−1
@@ -1,4 +1,3 @@
1−#include <linux/module.h>
21 #include <linux/fs.h>
32
43 #ifdef CONFIG_CGROUP_DEVICE
include/linux/dmaengine.h+2−0
@@ -25,6 +25,8 @@ · 24 unmodified lines
2525 #include <linux/uio.h>
2626 #include <linux/dma-direction.h>
2727 #include <linux/scatterlist.h>
28+#include <linux/bitmap.h>
29+#include <asm/page.h>
2830
2931 /**
3032 * typedef dma_cookie_t - an opaque DMA cookie
include/linux/export.h+89−0
@@ -0,0 +1,89 @@
1+#ifndef _LINUX_EXPORT_H
2+#define _LINUX_EXPORT_H
3+/*
4+ * Export symbols from the kernel to modules. Forked from module.h
5+ * to reduce the amount of pointless cruft we feed to gcc when only
6+ * exporting a simple symbol or two.
7+ *
8+ * If you feel the need to add #include <linux/foo.h> to this file
9+ * then you are doing something wrong and should go away silently.
10+ */
11+
12+/* Some toolchains use a `_' prefix for all user symbols. */
13+#ifdef CONFIG_SYMBOL_PREFIX
14+#define MODULE_SYMBOL_PREFIX CONFIG_SYMBOL_PREFIX
15+#else
16+#define MODULE_SYMBOL_PREFIX ""
17+#endif
18+
19+struct kernel_symbol
20+{
21+ unsigned long value;
22+ const char *name;
23+};
24+
25+#ifdef MODULE
26+extern struct module __this_module;
27+#define THIS_MODULE (&__this_module)
28+#else
29+#define THIS_MODULE ((struct module *)0)
30+#endif
31+
32+#ifdef CONFIG_MODULES
33+
34+#ifndef __GENKSYMS__
35+#ifdef CONFIG_MODVERSIONS
36+/* Mark the CRC weak since genksyms apparently decides not to
37+ * generate a checksums for some symbols */
38+#define __CRC_SYMBOL(sym, sec) \
39+ extern void *__crc_##sym __attribute__((weak)); \
40+ static const unsigned long __kcrctab_##sym \
41+ __used \
42+ __attribute__((section("___kcrctab" sec "+" #sym), unused)) \
43+ = (unsigned long) &__crc_##sym;
44+#else
45+#define __CRC_SYMBOL(sym, sec)
46+#endif
47+
48+/* For every exported symbol, place a struct in the __ksymtab section */
49+#define __EXPORT_SYMBOL(sym, sec) \
50+ extern typeof(sym) sym; \
51+ __CRC_SYMBOL(sym, sec) \
52+ static const char __kstrtab_##sym[] \
53+ __attribute__((section("__ksymtab_strings"), aligned(1))) \
54+ = MODULE_SYMBOL_PREFIX #sym; \
55+ static const struct kernel_symbol __ksymtab_##sym \
56+ __used \
57+ __attribute__((section("___ksymtab" sec "+" #sym), unused)) \
58+ = { (unsigned long)&sym, __kstrtab_##sym }
59+
60+#define EXPORT_SYMBOL(sym) \
61+ __EXPORT_SYMBOL(sym, "")
62+
63+#define EXPORT_SYMBOL_GPL(sym) \
64+ __EXPORT_SYMBOL(sym, "_gpl")
65+
66+#define EXPORT_SYMBOL_GPL_FUTURE(sym) \
67+ __EXPORT_SYMBOL(sym, "_gpl_future")
68+
69+#ifdef CONFIG_UNUSED_SYMBOLS
70+#define EXPORT_UNUSED_SYMBOL(sym) __EXPORT_SYMBOL(sym, "_unused")
71+#define EXPORT_UNUSED_SYMBOL_GPL(sym) __EXPORT_SYMBOL(sym, "_unused_gpl")
72+#else
73+#define EXPORT_UNUSED_SYMBOL(sym)
74+#define EXPORT_UNUSED_SYMBOL_GPL(sym)
75+#endif
76+
77+#endif /* __GENKSYMS__ */
78+
79+#else /* !CONFIG_MODULES... */
80+
81+#define EXPORT_SYMBOL(sym)
82+#define EXPORT_SYMBOL_GPL(sym)
83+#define EXPORT_SYMBOL_GPL_FUTURE(sym)
84+#define EXPORT_UNUSED_SYMBOL(sym)
85+#define EXPORT_UNUSED_SYMBOL_GPL(sym)
86+
87+#endif /* CONFIG_MODULES */
88+
89+#endif /* _LINUX_EXPORT_H */
include/linux/firmware.h+1−1
@@ -1,7 +1,6 @@
11 #ifndef _LINUX_FIRMWARE_H
22 #define _LINUX_FIRMWARE_H
33
4−#include <linux/module.h>
54 #include <linux/types.h>
65 #include <linux/compiler.h>
76 #include <linux/gfp.h>
@@ -15,6 +14,7 @@ struct firmware { · 7 unmodified lines
1514 struct page **pages;
1615 };
1716
17+struct module;
1818 struct device;
1919
2020 struct builtin_fw {
include/linux/ftrace.h+1−1
@@ -10,7 +10,6 @@ · 9 unmodified lines
1010 #include <linux/kallsyms.h>
1111 #include <linux/linkage.h>
1212 #include <linux/bitops.h>
13−#include <linux/module.h>
1413 #include <linux/ktime.h>
1514 #include <linux/sched.h>
1615 #include <linux/types.h>
@@ -19,6 +18,7 @@ · 2 unmodified lines
1918
2019 #include <asm/ftrace.h>
2120
21+struct module;
2222 struct ftrace_hash;
2323
2424 #ifdef CONFIG_FUNCTION_TRACER
include/linux/gameport.h+8−9
@@ -71,10 +71,9 @@ void gameport_close(struct gameport *gameport); · 70 unmodified lines
7171 #if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE))
7272
7373 void __gameport_register_port(struct gameport *gameport, struct module *owner);
74−static inline void gameport_register_port(struct gameport *gameport)
75−{
76− __gameport_register_port(gameport, THIS_MODULE);
77−}
74+/* use a define to avoid include chaining to get THIS_MODULE */
75+#define gameport_register_port(gameport) \
76+ __gameport_register_port(gameport, THIS_MODULE)
7877
7978 void gameport_unregister_port(struct gameport *gameport);
8079
@@ -145,12 +144,12 @@ static inline void gameport_unpin_driver(struct gameport *gameport) · 64 unmodified lines
145144 mutex_unlock(&gameport->drv_mutex);
146145 }
147146
148−int __gameport_register_driver(struct gameport_driver *drv,
147+int __must_check __gameport_register_driver(struct gameport_driver *drv,
149148 struct module *owner, const char *mod_name);
150−static inline int __must_check gameport_register_driver(struct gameport_driver *drv)
151−{
152− return __gameport_register_driver(drv, THIS_MODULE, KBUILD_MODNAME);
153−}
149+
150+/* use a define to avoid include chaining to get THIS_MODULE & friends */
151+#define gameport_register_driver(drv) \
152+ __gameport_register_driver(drv, THIS_MODULE, KBUILD_MODNAME)
154153
155154 void gameport_unregister_driver(struct gameport_driver *drv);
156155
include/linux/hid.h+5−4
@@ -697,10 +697,11 @@ extern void hid_destroy_device(struct hid_device *); · 696 unmodified lines
697697
698698 extern int __must_check __hid_register_driver(struct hid_driver *,
699699 struct module *, const char *mod_name);
700−static inline int __must_check hid_register_driver(struct hid_driver *driver)
701−{
702− return __hid_register_driver(driver, THIS_MODULE, KBUILD_MODNAME);
703−}
700+
701+/* use a define to avoid include chaining to get THIS_MODULE & friends */
702+#define hid_register_driver(driver) \
703+ __hid_register_driver(driver, THIS_MODULE, KBUILD_MODNAME)
704+
704705 extern void hid_unregister_driver(struct hid_driver *);
705706
706707 extern void hidinput_hid_event(struct hid_device *, struct hid_field *, struct hid_usage *, __s32);
include/linux/i2c.h+5−5
@@ -28,7 +28,6 @@ · 27 unmodified lines
2828
2929 #include <linux/types.h>
3030 #ifdef __KERNEL__
31−#include <linux/module.h>
3231 #include <linux/mod_devicetable.h>
3332 #include <linux/device.h> /* for struct device */
3433 #include <linux/sched.h> /* for completion */
@@ -49,6 +48,8 @@ struct i2c_driver; · 14 unmodified lines
4948 union i2c_smbus_data;
5049 struct i2c_board_info;
5150
51+struct module;
52+
5253 #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
5354 /*
5455 * The master routines are the ones normally used to transmit data to devices
@@ -451,10 +452,9 @@ extern int i2c_add_numbered_adapter(struct i2c_adapter *); · 396 unmodified lines
451452 extern int i2c_register_driver(struct module *, struct i2c_driver *);
452453 extern void i2c_del_driver(struct i2c_driver *);
453454
454−static inline int i2c_add_driver(struct i2c_driver *driver)
455−{
456− return i2c_register_driver(THIS_MODULE, driver);
457−}
455+/* use a define to avoid include chaining to get THIS_MODULE */
456+#define i2c_add_driver(driver) \
457+ i2c_register_driver(THIS_MODULE, driver)
458458
459459 extern struct i2c_client *i2c_use_client(struct i2c_client *client);
460460 extern void i2c_release_client(struct i2c_client *client);
include/linux/ipmi.h+2−1
@@ -220,10 +220,11 @@ struct kernel_ipmi_msg { · 219 unmodified lines
220220 * The in-kernel interface.
221221 */
222222 #include <linux/list.h>
223−#include <linux/module.h>
224223 #include <linux/device.h>
225224 #include <linux/proc_fs.h>
226225
226+struct module;
227+
227228 /* Opaque type for a IPMI message user. One of these is needed to
228229 send and receive messages. */
229230 typedef struct ipmi_user *ipmi_user_t;
include/linux/ipmi_smi.h+0−1
@@ -36,7 +36,6 @@ · 35 unmodified lines
3636
3737 #include <linux/ipmi_msgdefs.h>
3838 #include <linux/proc_fs.h>
39−#include <linux/module.h>
4039 #include <linux/device.h>
4140 #include <linux/platform_device.h>
4241 #include <linux/ipmi.h>
include/linux/irq.h+12−20
@@ -23,13 +23,13 @@ · 22 unmodified lines
2323 #include <linux/errno.h>
2424 #include <linux/topology.h>
2525 #include <linux/wait.h>
26−#include <linux/module.h>
2726
2827 #include <asm/irq.h>
2928 #include <asm/ptrace.h>
3029 #include <asm/irq_regs.h>
3130
3231 struct seq_file;
32+struct module;
3333 struct irq_desc;
3434 struct irq_data;
3535 typedef void (*irq_flow_handler_t)(unsigned int irq,
@@ -567,29 +567,21 @@ static inline struct msi_desc *irq_data_get_msi(struct irq_data *d) · 531 unmodified lines
567567 int __irq_alloc_descs(int irq, unsigned int from, unsigned int cnt, int node,
568568 struct module *owner);
569569
570−static inline int irq_alloc_descs(int irq, unsigned int from, unsigned int cnt,
571− int node)
572−{
573− return __irq_alloc_descs(irq, from, cnt, node, THIS_MODULE);
574−}
570+/* use macros to avoid needing export.h for THIS_MODULE */
571+#define irq_alloc_descs(irq, from, cnt, node) \
572+ __irq_alloc_descs(irq, from, cnt, node, THIS_MODULE)
575573
576−void irq_free_descs(unsigned int irq, unsigned int cnt);
577−int irq_reserve_irqs(unsigned int from, unsigned int cnt);
574+#define irq_alloc_desc(node) \
575+ irq_alloc_descs(-1, 0, 1, node)
578576
579−static inline int irq_alloc_desc(int node)
580−{
581− return irq_alloc_descs(-1, 0, 1, node);
582−}
577+#define irq_alloc_desc_at(at, node) \
578+ irq_alloc_descs(at, at, 1, node)
583579
584−static inline int irq_alloc_desc_at(unsigned int at, int node)
585−{
586− return irq_alloc_descs(at, at, 1, node);
587−}
580+#define irq_alloc_desc_from(from, node) \
581+ irq_alloc_descs(-1, from, 1, node)
588582
589−static inline int irq_alloc_desc_from(unsigned int from, int node)
590−{
591− return irq_alloc_descs(-1, from, 1, node);
592−}
583+void irq_free_descs(unsigned int irq, unsigned int cnt);
584+int irq_reserve_irqs(unsigned int from, unsigned int cnt);
593585
594586 static inline void irq_free_desc(unsigned int irq)
595587 {
include/linux/irqdesc.h+1−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 struct irq_affinity_notify;
1212 struct proc_dir_entry;
1313 struct timer_rand_state;
14+struct module;
1415 /**
1516 * struct irq_desc - interrupt descriptor
1617 * @irq_data: per irq and chip data passed down to chip functions
include/linux/mdio-bitbang.h+2−1
@@ -2,7 +2,8 @@ · 1 unmodified line
22 #define __LINUX_MDIO_BITBANG_H
33
44 #include <linux/phy.h>
5−#include <linux/module.h>
5+
6+struct module;
67
78 struct mdiobb_ctrl;
89
include/linux/miscdevice.h+2−1
@@ -1,7 +1,8 @@
11 #ifndef _LINUX_MISCDEVICE_H
22 #define _LINUX_MISCDEVICE_H
3−#include <linux/module.h>
43 #include <linux/major.h>
4+#include <linux/list.h>
5+#include <linux/types.h>
56
67 /*
78 * These allocations are managed by device@lanana.org. If you use an
include/linux/module.h+1−72
@@ -16,6 +16,7 @@ · 15 unmodified lines
1616 #include <linux/kobject.h>
1717 #include <linux/moduleparam.h>
1818 #include <linux/tracepoint.h>
19+#include <linux/export.h>
1920
2021 #include <linux/percpu.h>
2122 #include <asm/module.h>
@@ -25,21 +26,8 @@ · 3 unmodified lines
2526 /* Not Yet Implemented */
2627 #define MODULE_SUPPORTED_DEVICE(name)
2728
28−/* Some toolchains use a `_' prefix for all user symbols. */
29−#ifdef CONFIG_SYMBOL_PREFIX
30−#define MODULE_SYMBOL_PREFIX CONFIG_SYMBOL_PREFIX
31−#else
32−#define MODULE_SYMBOL_PREFIX ""
33−#endif
34−
3529 #define MODULE_NAME_LEN MAX_PARAM_PREFIX_LEN
3630
37−struct kernel_symbol
38−{
39− unsigned long value;
40− const char *name;
41−};
42−
4331 struct modversion_info
4432 {
4533 unsigned long crc;
@@ -98,11 +86,8 @@ void trim_init_extable(struct module *m); · 52 unmodified lines
9886 extern const struct gtype##_id __mod_##gtype##_table \
9987 __attribute__ ((unused, alias(__stringify(name))))
10088
101−extern struct module __this_module;
102−#define THIS_MODULE (&__this_module)
10389 #else /* !MODULE */
10490 #define MODULE_GENERIC_TABLE(gtype,name)
105−#define THIS_MODULE ((struct module *)0)
10691 #endif
10792
10893 /* Generic info of form tag = "info" */
@@ -150,11 +135,6 @@ extern struct module __this_module; · 41 unmodified lines
150135 /* What your module does. */
151136 #define MODULE_DESCRIPTION(_description) MODULE_INFO(description, _description)
152137
153−/* One for each parameter, describing how to use it. Some files do
154− multiple of these per line, so can't just use MODULE_INFO. */
155−#define MODULE_PARM_DESC(_parm, desc) \
156− __MODULE_INFO(parm, _parm, #_parm ":" desc)
157−
158138 #define MODULE_DEVICE_TABLE(type,name) \
159139 MODULE_GENERIC_TABLE(type##_device,name)
160140
@@ -218,52 +198,6 @@ struct module_use { · 57 unmodified lines
218198 struct module *source, *target;
219199 };
220200
221−#ifndef __GENKSYMS__
222−#ifdef CONFIG_MODVERSIONS
223−/* Mark the CRC weak since genksyms apparently decides not to
224− * generate a checksums for some symbols */
225−#define __CRC_SYMBOL(sym, sec) \
226− extern void *__crc_##sym __attribute__((weak)); \
227− static const unsigned long __kcrctab_##sym \
228− __used \
229− __attribute__((section("___kcrctab" sec "+" #sym), unused)) \
230− = (unsigned long) &__crc_##sym;
231−#else
232−#define __CRC_SYMBOL(sym, sec)
233−#endif
234−
235−/* For every exported symbol, place a struct in the __ksymtab section */
236−#define __EXPORT_SYMBOL(sym, sec) \
237− extern typeof(sym) sym; \
238− __CRC_SYMBOL(sym, sec) \
239− static const char __kstrtab_##sym[] \
240− __attribute__((section("__ksymtab_strings"), aligned(1))) \
241− = MODULE_SYMBOL_PREFIX #sym; \
242− static const struct kernel_symbol __ksymtab_##sym \
243− __used \
244− __attribute__((section("___ksymtab" sec "+" #sym), unused)) \
245− = { (unsigned long)&sym, __kstrtab_##sym }
246−
247−#define EXPORT_SYMBOL(sym) \
248− __EXPORT_SYMBOL(sym, "")
249−
250−#define EXPORT_SYMBOL_GPL(sym) \
251− __EXPORT_SYMBOL(sym, "_gpl")
252−
253−#define EXPORT_SYMBOL_GPL_FUTURE(sym) \
254− __EXPORT_SYMBOL(sym, "_gpl_future")
255−
256−
257−#ifdef CONFIG_UNUSED_SYMBOLS
258−#define EXPORT_UNUSED_SYMBOL(sym) __EXPORT_SYMBOL(sym, "_unused")
259−#define EXPORT_UNUSED_SYMBOL_GPL(sym) __EXPORT_SYMBOL(sym, "_unused_gpl")
260−#else
261−#define EXPORT_UNUSED_SYMBOL(sym)
262−#define EXPORT_UNUSED_SYMBOL_GPL(sym)
263−#endif
264−
265−#endif
266−
267201 enum module_state
268202 {
269203 MODULE_STATE_LIVE,
@@ -581,11 +515,6 @@ int unregister_module_notifier(struct notifier_block * nb); · 311 unmodified lines
581515 extern void print_modules(void);
582516
583517 #else /* !CONFIG_MODULES... */
584−#define EXPORT_SYMBOL(sym)
585−#define EXPORT_SYMBOL_GPL(sym)
586−#define EXPORT_SYMBOL_GPL_FUTURE(sym)
587−#define EXPORT_UNUSED_SYMBOL(sym)
588−#define EXPORT_UNUSED_SYMBOL_GPL(sym)
589518
590519 /* Given an address, look for it in the exception tables. */
591520 static inline const struct exception_table_entry *
include/linux/moduleparam.h+5−0
@@ -31,6 +31,11 @@ static const char __module_cat(name,__LINE__)[] \ · 30 unmodified lines
3131 #define __MODULE_PARM_TYPE(name, _type) \
3232 __MODULE_INFO(parmtype, name##type, #name ":" _type)
3333
34+/* One for each parameter, describing how to use it. Some files do
35+ multiple of these per line, so can't just use MODULE_INFO. */
36+#define MODULE_PARM_DESC(_parm, desc) \
37+ __MODULE_INFO(parm, _parm, #_parm ":" desc)
38+
3439 struct kernel_param;
3540
3641 struct kernel_param_ops {
include/linux/mtd/mtd.h+2−1
@@ -21,7 +21,6 @@ · 20 unmodified lines
2121 #define __MTD_MTD_H__
2222
2323 #include <linux/types.h>
24−#include <linux/module.h>
2524 #include <linux/uio.h>
2625 #include <linux/notifier.h>
2726 #include <linux/device.h>
@@ -125,6 +124,8 @@ struct nand_ecclayout { · 97 unmodified lines
125124 struct nand_oobfree oobfree[MTD_MAX_OOBFREE_ENTRIES_LARGE];
126125 };
127126
127+struct module; /* only needed for owner field in mtd_info */
128+
128129 struct mtd_info {
129130 u_char type;
130131 uint32_t flags;
include/linux/of.h+1−0
@@ -23,6 +23,7 @@ · 22 unmodified lines
2323 #include <linux/spinlock.h>
2424
2525 #include <asm/byteorder.h>
26+#include <asm/errno.h>
2627
2728 typedef u32 phandle;
2829 typedef u32 ihandle;
include/linux/of_platform.h+0−1
@@ -12,7 +12,6 @@ · 11 unmodified lines
1212 */
1313
1414 #ifdef CONFIG_OF_DEVICE
15−#include <linux/module.h>
1615 #include <linux/device.h>
1716 #include <linux/mod_devicetable.h>
1817 #include <linux/pm.h>
include/linux/pci_hotplug.h+3−7
@@ -132,13 +132,9 @@ extern int pci_hp_deregister(struct hotplug_slot *slot); · 131 unmodified lines
132132 extern int __must_check pci_hp_change_slot_info (struct hotplug_slot *slot,
133133 struct hotplug_slot_info *info);
134134
135−static inline int pci_hp_register(struct hotplug_slot *slot,
136− struct pci_bus *pbus,
137− int devnr, const char *name)
138−{
139− return __pci_hp_register(slot, pbus, devnr, name,
140− THIS_MODULE, KBUILD_MODNAME);
141−}
135+/* use a define to avoid include chaining to get THIS_MODULE & friends */
136+#define pci_hp_register(slot, pbus, devnr, name) \
137+ __pci_hp_register(slot, pbus, devnr, name, THIS_MODULE, KBUILD_MODNAME)
142138
143139 /* PCI Setting Record (Type 0) */
144140 struct hpp_type0 {
include/linux/pm_runtime.h+1−0
@@ -10,6 +10,7 @@ · 9 unmodified lines
1010 #define _LINUX_PM_RUNTIME_H
1111
1212 #include <linux/device.h>
13+#include <linux/notifier.h>
1314 #include <linux/pm.h>
1415
1516 #include <linux/jiffies.h>
include/linux/regmap.h+1−1
@@ -15,8 +15,8 @@ · 14 unmodified lines
1515
1616 #include <linux/device.h>
1717 #include <linux/list.h>
18−#include <linux/module.h>
1918
19+struct module;
2020 struct i2c_client;
2121 struct spi_device;
2222
include/linux/regulator/driver.h+1−0
@@ -16,6 +16,7 @@ · 15 unmodified lines
1616 #define __LINUX_REGULATOR_DRIVER_H_
1717
1818 #include <linux/device.h>
19+#include <linux/notifier.h>
1920 #include <linux/regulator/consumer.h>
2021
2122 struct regulator_dev;
include/linux/serio.h+11−9
@@ -79,19 +79,21 @@ void serio_reconnect(struct serio *serio); · 78 unmodified lines
7979 irqreturn_t serio_interrupt(struct serio *serio, unsigned char data, unsigned int flags);
8080
8181 void __serio_register_port(struct serio *serio, struct module *owner);
82−static inline void serio_register_port(struct serio *serio)
83−{
84− __serio_register_port(serio, THIS_MODULE);
85−}
82+
83+/* use a define to avoid include chaining to get THIS_MODULE */
84+#define serio_register_port(serio) \
85+ __serio_register_port(serio, THIS_MODULE)
8686
8787 void serio_unregister_port(struct serio *serio);
8888 void serio_unregister_child_port(struct serio *serio);
8989
90−int __serio_register_driver(struct serio_driver *drv, struct module *owner, const char *mod_name);
91−static inline int __must_check serio_register_driver(struct serio_driver *drv)
92−{
93− return __serio_register_driver(drv, THIS_MODULE, KBUILD_MODNAME);
94−}
90+int __must_check __serio_register_driver(struct serio_driver *drv,
91+ struct module *owner, const char *mod_name);
92+
93+/* use a define to avoid include chaining to get THIS_MODULE & friends */
94+#define serio_register_driver(drv) \
95+ __serio_register_driver(drv, THIS_MODULE, KBUILD_MODNAME)
96+
9597 void serio_unregister_driver(struct serio_driver *drv);
9698
9799 static inline int serio_write(struct serio *serio, unsigned char data)
include/linux/ssb/ssb.h+3−4
@@ -231,10 +231,9 @@ struct ssb_driver { · 230 unmodified lines
231231 #define drv_to_ssb_drv(_drv) container_of(_drv, struct ssb_driver, drv)
232232
233233 extern int __ssb_driver_register(struct ssb_driver *drv, struct module *owner);
234−static inline int ssb_driver_register(struct ssb_driver *drv)
235−{
236− return __ssb_driver_register(drv, THIS_MODULE);
237−}
234+#define ssb_driver_register(drv) \
235+ __ssb_driver_register(drv, THIS_MODULE)
236+
238237 extern void ssb_driver_unregister(struct ssb_driver *drv);
239238
240239
include/linux/stop_machine.h+1−0
@@ -3,6 +3,7 @@ · 2 unmodified lines
33
44 #include <linux/cpu.h>
55 #include <linux/cpumask.h>
6+#include <linux/smp.h>
67 #include <linux/list.h>
78 #include <asm/system.h>
89
include/linux/sunrpc/svc_xprt.h+2−1
@@ -8,7 +8,8 @@ · 7 unmodified lines
88 #define SUNRPC_SVC_XPRT_H
99
1010 #include <linux/sunrpc/svc.h>
11−#include <linux/module.h>
11+
12+struct module;
1213
1314 struct svc_xprt_ops {
1415 struct svc_xprt *(*xpo_create)(struct svc_serv *,
include/linux/sysdev.h+0−1
@@ -22,7 +22,6 @@ · 21 unmodified lines
2222 #define _SYSDEV_H_
2323
2424 #include <linux/kobject.h>
25−#include <linux/module.h>
2625 #include <linux/pm.h>
2726
2827
include/linux/textsearch.h+2−1
@@ -4,10 +4,11 @@ · 3 unmodified lines
44 #include <linux/types.h>
55 #include <linux/list.h>
66 #include <linux/kernel.h>
7−#include <linux/module.h>
87 #include <linux/err.h>
98 #include <linux/slab.h>
109
10+struct module;
11+
1112 struct ts_config;
1213
1314 #define TS_AUTOLOAD 1 /* Automatically load textsearch modules when needed */
include/linux/uio_driver.h+6−6
@@ -14,10 +14,10 @@ · 13 unmodified lines
1414 #ifndef _UIO_DRIVER_H_
1515 #define _UIO_DRIVER_H_
1616
17−#include <linux/module.h>
1817 #include <linux/fs.h>
1918 #include <linux/interrupt.h>
2019
20+struct module;
2121 struct uio_map;
2222
2323 /**
@@ -101,11 +101,11 @@ extern int __must_check · 77 unmodified lines
101101 __uio_register_device(struct module *owner,
102102 struct device *parent,
103103 struct uio_info *info);
104−static inline int __must_check
105− uio_register_device(struct device *parent, struct uio_info *info)
106−{
107− return __uio_register_device(THIS_MODULE, parent, info);
108−}
104+
105+/* use a define to avoid include chaining to get THIS_MODULE */
106+#define uio_register_device(parent, info) \
107+ __uio_register_device(THIS_MODULE, parent, info)
108+
109109 extern void uio_unregister_device(struct uio_info *info);
110110 extern void uio_event_notify(struct uio_info *info);
111111
include/linux/usb.h+5−4
@@ -946,10 +946,11 @@ struct usb_class_driver { · 945 unmodified lines
946946 */
947947 extern int usb_register_driver(struct usb_driver *, struct module *,
948948 const char *);
949−static inline int usb_register(struct usb_driver *driver)
950−{
951− return usb_register_driver(driver, THIS_MODULE, KBUILD_MODNAME);
952−}
949+
950+/* use a define to avoid include chaining to get THIS_MODULE & friends */
951+#define usb_register(driver) \
952+ usb_register_driver(driver, THIS_MODULE, KBUILD_MODNAME)
953+
953954 extern void usb_deregister(struct usb_driver *);
954955
955956 extern int usb_register_device_driver(struct usb_device_driver *,
include/linux/uwb.h+1−0
@@ -33,6 +33,7 @@ · 32 unmodified lines
3333 #include <linux/wait.h>
3434 #include <linux/workqueue.h>
3535 #include <linux/uwb/spec.h>
36+#include <asm/page.h>
3637
3738 struct uwb_dev;
3839 struct uwb_beca_e;
include/linux/uwb/umc.h+3−4
@@ -111,10 +111,9 @@ int __must_check __umc_driver_register(struct umc_driver *umc_drv, · 110 unmodified lines
111111 * umc_driver_register - register a UMC capabiltity driver.
112112 * @umc_drv: pointer to the driver.
113113 */
114−static inline int __must_check umc_driver_register(struct umc_driver *umc_drv)
115−{
116− return __umc_driver_register(umc_drv, THIS_MODULE, KBUILD_MODNAME);
117−}
114+#define umc_driver_register(umc_drv) \
115+ __umc_driver_register(umc_drv, THIS_MODULE, KBUILD_MODNAME)
116+
118117 void umc_driver_unregister(struct umc_driver *umc_drv);
119118
120119 /*
include/linux/vermagic.h+0−1
@@ -1,5 +1,4 @@
11 #include <generated/utsrelease.h>
2−#include <linux/module.h>
32
43 /* Simply sanity version stamp for modules. */
54 #ifdef CONFIG_SMP
include/linux/vlynq.h+2−1
@@ -20,9 +20,10 @@ · 19 unmodified lines
2020 #define __VLYNQ_H__
2121
2222 #include <linux/device.h>
23−#include <linux/module.h>
2423 #include <linux/types.h>
2524
25+struct module;
26+
2627 #define VLYNQ_NUM_IRQS 32
2728
2829 struct vlynq_mapping {
include/media/saa7146.h+2−1
@@ -1,7 +1,6 @@
11 #ifndef __SAA7146__
22 #define __SAA7146__
33
4−#include <linux/module.h> /* for module-version */
54 #include <linux/delay.h> /* for delay-stuff */
65 #include <linux/slab.h> /* for kmalloc/kfree */
76 #include <linux/pci.h> /* for pci-config-stuff, vendor ids etc. */
@@ -55,6 +54,8 @@ do { \ · 47 unmodified lines
5554 #define SAA7146_ISR_CLEAR(x,y) \
5655 saa7146_write(x, ISR, (y));
5756
57+struct module;
58+
5859 struct saa7146_dev;
5960 struct saa7146_extension;
6061 struct saa7146_vv;
include/media/v4l2-int-device.h+2−1
@@ -25,7 +25,6 @@ · 24 unmodified lines
2525 #ifndef V4L2_INT_DEVICE_H
2626 #define V4L2_INT_DEVICE_H
2727
28−#include <linux/module.h>
2928 #include <media/v4l2-common.h>
3029
3130 #define V4L2NAMESIZE 32
@@ -41,6 +40,8 @@ enum v4l2_int_type { · 9 unmodified lines
4140 v4l2_int_type_slave
4241 };
4342
43+struct module;
44+
4445 struct v4l2_int_device;
4546
4647 struct v4l2_int_master {
include/net/bluetooth/hci_core.h+13−11
@@ -513,11 +513,15 @@ static inline void __hci_dev_put(struct hci_dev *d) · 512 unmodified lines
513513 d->destruct(d);
514514 }
515515
516−static inline void hci_dev_put(struct hci_dev *d)
517−{
518− __hci_dev_put(d);
519− module_put(d->owner);
520−}
516+/*
517+ * hci_dev_put and hci_dev_hold are macros to avoid dragging all the
518+ * overhead of all the modular infrastructure into this header.
519+ */
520+#define hci_dev_put(d) \
521+do { \
522+ __hci_dev_put(d); \
523+ module_put(d->owner); \
524+} while (0)
521525
522526 static inline struct hci_dev *__hci_dev_hold(struct hci_dev *d)
523527 {
@@ -525,12 +529,10 @@ static inline struct hci_dev *__hci_dev_hold(struct hci_dev *d) · 1 unmodified line
525529 return d;
526530 }
527531
528−static inline struct hci_dev *hci_dev_hold(struct hci_dev *d)
529−{
530− if (try_module_get(d->owner))
531− return __hci_dev_hold(d);
532− return NULL;
533−}
532+#define hci_dev_hold(d) \
533+({ \
534+ try_module_get(d->owner) ? __hci_dev_hold(d) : NULL; \
535+})
534536
535537 #define hci_dev_lock(d) spin_lock(&d->lock)
536538 #define hci_dev_unlock(d) spin_unlock(&d->lock)
include/net/inet_timewait_sock.h+0−1
@@ -18,7 +18,6 @@ · 17 unmodified lines
1818
1919 #include <linux/kmemcheck.h>
2020 #include <linux/list.h>
21−#include <linux/module.h>
2221 #include <linux/timer.h>
2322 #include <linux/types.h>
2423 #include <linux/workqueue.h>
include/net/ip_vs.h+7−8
@@ -1126,17 +1126,16 @@ int unregister_ip_vs_pe(struct ip_vs_pe *pe); · 1125 unmodified lines
11261126 struct ip_vs_pe *ip_vs_pe_getbyname(const char *name);
11271127 struct ip_vs_pe *__ip_vs_pe_getbyname(const char *pe_name);
11281128
1129−static inline void ip_vs_pe_get(const struct ip_vs_pe *pe)
1130−{
1131− if (pe && pe->module)
1129+/*
1130+ * Use a #define to avoid all of module.h just for these trivial ops
1131+ */
1132+#define ip_vs_pe_get(pe) \
1133+ if (pe && pe->module) \
11321134 __module_get(pe->module);
1133−}
11341135
1135−static inline void ip_vs_pe_put(const struct ip_vs_pe *pe)
1136−{
1137− if (pe && pe->module)
1136+#define ip_vs_pe_put(pe) \
1137+ if (pe && pe->module) \
11381138 module_put(pe->module);
1139−}
11401139
11411140 /*
11421141 * IPVS protocol functions (from ip_vs_proto.c)
include/net/lib80211.h+2−1
@@ -25,7 +25,6 @@ · 24 unmodified lines
2525
2626 #include <linux/types.h>
2727 #include <linux/list.h>
28−#include <linux/module.h>
2928 #include <linux/atomic.h>
3029 #include <linux/if.h>
3130 #include <linux/skbuff.h>
@@ -42,6 +41,8 @@ enum { · 10 unmodified lines
4241 IEEE80211_CRYPTO_TKIP_COUNTERMEASURES = (1 << 0),
4342 };
4443
44+struct module;
45+
4546 struct lib80211_crypto_ops {
4647 const char *name;
4748 struct list_head list;
include/net/netfilter/nf_conntrack.h+2−0
@@ -313,6 +313,8 @@ static inline bool nf_is_loopback_packet(const struct sk_buff *skb) · 312 unmodified lines
313313 return skb->dev && skb->skb_iif && skb->dev->flags & IFF_LOOPBACK;
314314 }
315315
316+struct kernel_param;
317+
316318 extern int nf_conntrack_set_hashsize(const char *val, struct kernel_param *kp);
317319 extern unsigned int nf_conntrack_htable_size;
318320 extern unsigned int nf_conntrack_max;
include/net/sch_generic.h+0−1
@@ -4,7 +4,6 @@ · 3 unmodified lines
44 #include <linux/netdevice.h>
55 #include <linux/types.h>
66 #include <linux/rcupdate.h>
7−#include <linux/module.h>
87 #include <linux/pkt_sched.h>
98 #include <linux/pkt_cls.h>
109 #include <net/gen_stats.h>
include/net/sock.h+1−1
@@ -46,7 +46,6 @@ · 45 unmodified lines
4646 #include <linux/list_nulls.h>
4747 #include <linux/timer.h>
4848 #include <linux/cache.h>
49−#include <linux/module.h>
5049 #include <linux/lockdep.h>
5150 #include <linux/netdevice.h>
5251 #include <linux/skbuff.h> /* struct sk_buff */
@@ -729,6 +728,7 @@ struct request_sock_ops; · 676 unmodified lines
729728 struct timewait_sock_ops;
730729 struct inet_hashinfo;
731730 struct raw_hashinfo;
731+struct module;
732732
733733 /* Networking protocol blocks we attach to sockets.
734734 * socket layer -> transport layer interface
include/sound/core.h+1−1
@@ -22,7 +22,6 @@ · 21 unmodified lines
2222 *
2323 */
2424
25−#include <linux/module.h>
2625 #include <linux/sched.h> /* wake_up() */
2726 #include <linux/mutex.h> /* struct mutex */
2827 #include <linux/rwsem.h> /* struct rw_semaphore */
@@ -43,6 +42,7 @@ · 14 unmodified lines
4342 #ifdef CONFIG_PCI
4443 struct pci_dev;
4544 #endif
45+struct module;
4646
4747 /* device allocation stuff */
4848
include/trace/define_trace.h+0−10
@@ -21,16 +21,6 @@ · 20 unmodified lines
2121 #undef CREATE_TRACE_POINTS
2222
2323 #include <linux/stringify.h>
24−/*
25− * module.h includes tracepoints, and because ftrace.h
26− * pulls in module.h:
27− * trace/ftrace.h -> linux/ftrace_event.h -> linux/perf_event.h ->
28− * linux/ftrace.h -> linux/module.h
29− * we must include module.h here before we play with any of
30− * the TRACE_EVENT() macros, otherwise the tracepoints included
31− * by module.h may break the build.
32− */
33−#include <linux/module.h>
3424
3525 #undef TRACE_EVENT
3626 #define TRACE_EVENT(name, proto, args, tstruct, assign, print) \
include/trace/events/module.h+1−1
@@ -1,6 +1,6 @@
11 /*
22 * Because linux/module.h has tracepoints in the header, and ftrace.h
3− * eventually includes this file, define_trace.h includes linux/module.h
3+ * used to include this file, define_trace.h includes linux/module.h
44 * But we do not want the module.h to override the TRACE_SYSTEM macro
55 * variable that define_trace.h is processing, so we only set it
66 * when module events are being processed, which would happen when
include/xen/xenbus.h+1−0
@@ -37,6 +37,7 @@ · 36 unmodified lines
3737 #include <linux/device.h>
3838 #include <linux/notifier.h>
3939 #include <linux/mutex.h>
40+#include <linux/export.h>
4041 #include <linux/completion.h>
4142 #include <linux/init.h>
4243 #include <linux/slab.h>