+#define MODULE_VERSION(_version) __MODULE_INFO_DISABLED(version)
#else
#define MODULE_VERSION(_version) \
- static struct module_version_attribute ___modver_attr = { \
-@@ -272,7 +275,7 @@ extern typeof(name) __mod_##type##__##na
+ MODULE_INFO(version, _version); \
+@@ -273,7 +276,7 @@ extern typeof(name) __mod_##type##__##na
/* Optional firmware file (or files) needed by the module
* format is simply firmware file name. Multiple firmware
* files require multiple MODULE_FIRMWARE() specifiers */
--- a/include/linux/moduleparam.h
+++ b/include/linux/moduleparam.h
-@@ -17,6 +17,16 @@
+@@ -20,6 +20,16 @@
/* Chosen so that structs with an unsigned long line up. */
#define MAX_PARAM_PREFIX_LEN (64 - sizeof(unsigned long))
+#define __MODULE_INFO_STRIP(tag, name, info) __MODULE_INFO(tag, name, info)
+#endif
+
- #ifdef MODULE
#define __MODULE_INFO(tag, name, info) \
static const char __UNIQUE_ID(name)[] \
-@@ -24,8 +34,7 @@ static const char __UNIQUE_ID(name)[]
- = __stringify(tag) "=" info
- #else /* !MODULE */
- /* This struct is here for syntactic coherency, it is not used */
--#define __MODULE_INFO(tag, name, info) \
-- struct __UNIQUE_ID(name) {}
-+#define __MODULE_INFO(tag, name, info) __MODULE_INFO_DISABLED(name)
- #endif
- #define __MODULE_PARM_TYPE(name, _type) \
- __MODULE_INFO(parmtype, name##type, #name ":" _type)
-@@ -33,7 +42,7 @@ static const char __UNIQUE_ID(name)[]
+ __used __attribute__((section(".modinfo"), unused, aligned(1))) \
+@@ -31,7 +41,7 @@ static const char __UNIQUE_ID(name)[]
/* One for each parameter, describing how to use it. Some files do
multiple of these per line, so can't just use MODULE_INFO. */
#define MODULE_PARM_DESC(_parm, desc) \
--- a/init/Kconfig
+++ b/init/Kconfig
-@@ -2054,6 +2054,13 @@ config TRIM_UNUSED_KSYMS
+@@ -2077,6 +2077,13 @@ config TRIM_UNUSED_KSYMS
If unsure, or if you need to build out-of-tree modules, say N.
config MODULES_TREE_LOOKUP
--- a/kernel/module.c
+++ b/kernel/module.c
-@@ -3007,9 +3007,11 @@ static int setup_load_info(struct load_i
+@@ -2992,9 +2992,11 @@ static int setup_load_info(struct load_i
static int check_modinfo(struct module *mod, struct load_info *info, int flags)
{
if (flags & MODULE_INIT_IGNORE_VERMAGIC)
modmagic = NULL;
-@@ -3030,6 +3032,7 @@ static int check_modinfo(struct module *
+@@ -3015,6 +3017,7 @@ static int check_modinfo(struct module *
mod->name);
add_taint_module(mod, TAINT_OOT_MODULE, LOCKDEP_STILL_OK);
}