summaryrefslogtreecommitdiff
path: root/include/linux/export.h
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2023-11-26 10:19:14 +0300
committerMasahiro Yamada <masahiroy@kernel.org>2023-12-10 09:32:48 +0300
commit5b20755b7780464fea3e54af0af744258dcc2841 (patch)
treedd4b6f346d798784f2e1125c7110658aaff060bd /include/linux/export.h
parent6262afa10ef7cc8fdf39b81a36f9546b68810431 (diff)
downloadlinux-5b20755b7780464fea3e54af0af744258dcc2841.tar.xz
init: move THIS_MODULE from <linux/export.h> to <linux/init.h>
Commit f50169324df4 ("module.h: split out the EXPORT_SYMBOL into export.h") appropriately separated EXPORT_SYMBOL into <linux/export.h> because modules and EXPORT_SYMBOL are orthogonal; modules are symbol consumers, while EXPORT_SYMBOL are used by symbol providers, which may not be necessarily a module. However, that commit also relocated THIS_MODULE. As explained in the commit description, the intention was to define THIS_MODULE in a lightweight header, but I do not believe <linux/export.h> was the best location because EXPORT_SYMBOL and THIS_MODULE are unrelated. Move it to another lightweight header, <linux/init.h>. The reason for choosing <linux/init.h> is to make <linux/moduleparam.h> self-contained without relying on <linux/linkage.h> incorrectly including <linux/export.h>. With this adjustment, the role of <linux/export.h> becomes clearer as it only defines EXPORT_SYMBOL. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>
Diffstat (limited to 'include/linux/export.h')
-rw-r--r--include/linux/export.h18
1 files changed, 0 insertions, 18 deletions
diff --git a/include/linux/export.h b/include/linux/export.h
index 9911508a9604..0bbd02fd351d 100644
--- a/include/linux/export.h
+++ b/include/linux/export.h
@@ -7,15 +7,6 @@
#include <linux/stringify.h>
/*
- * Export symbols from the kernel to modules. Forked from module.h
- * to reduce the amount of pointless cruft we feed to gcc when only
- * exporting a simple symbol or two.
- *
- * Try not to add #includes here. It slows compilation and makes kernel
- * hackers place grumpy comments in header files.
- */
-
-/*
* This comment block is used by fixdep. Please do not remove.
*
* When CONFIG_MODVERSIONS is changed from n to y, all source files having
@@ -23,15 +14,6 @@
* side effect of the *.o build rule.
*/
-#ifndef __ASSEMBLY__
-#ifdef MODULE
-extern struct module __this_module;
-#define THIS_MODULE (&__this_module)
-#else
-#define THIS_MODULE ((struct module *)0)
-#endif
-#endif /* __ASSEMBLY__ */
-
#ifdef CONFIG_64BIT
#define __EXPORT_SYMBOL_REF(sym) \
.balign 8 ASM_NL \