--- zzzz-none-000/linux-5.4.213/include/linux/moduleparam.h 2022-09-15 10:04:56.000000000 +0000 +++ miami-7690-761/linux-5.4.213/include/linux/moduleparam.h 2024-05-29 11:20:02.000000000 +0000 @@ -20,10 +20,24 @@ /* Chosen so that structs with an unsigned long line up. */ #define MAX_PARAM_PREFIX_LEN (64 - sizeof(unsigned long)) +/* This struct is here for syntactic coherency, it is not used */ +#define __MODULE_INFO_DISABLED(name) \ + struct __UNIQUE_ID(name) {} + +#ifdef CONFIG_MODULE_STRIPPED +#define __MODULE_INFO_STRIP(tag, name, info) __MODULE_INFO_DISABLED(name) +#else +#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)[] \ __used __attribute__((section(".modinfo"), unused, aligned(1))) \ = __MODULE_INFO_PREFIX __stringify(tag) "=" info +#else +#define __MODULE_INFO(tag, name, info) __MODULE_INFO_DISABLED(name) +#endif #define __MODULE_PARM_TYPE(name, _type) \ __MODULE_INFO(parmtype, name##type, #name ":" _type) @@ -31,7 +45,7 @@ /* 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) \ - __MODULE_INFO(parm, _parm, #_parm ":" desc) + __MODULE_INFO_STRIP(parm, _parm, #_parm ":" desc) struct kernel_param;