kernel: make make patches/files apply/compile for kernel 5.2
[openwrt/staging/mkresin.git] / target / linux / generic / hack-5.2 / 204-module_strip.patch
index 7a285760ae70eb2b47a4063a18e46d86cbc84419..74f5f8daa2e71ebdd67042d763ba56d98e4d676a 100644 (file)
@@ -48,8 +48,8 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
 +#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 */
@@ -60,7 +60,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  
 --- 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))
  
@@ -74,20 +74,10 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
 +#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) \
@@ -98,7 +88,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  
 --- 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.
  
@@ -114,7 +104,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  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)
  {
@@ -127,7 +117,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        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);
        }