]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
params: Replace __modinit with __init_or_module
authorPetr Pavlu <petr.pavlu@suse.com>
Tue, 19 Aug 2025 12:12:09 +0000 (14:12 +0200)
committerSami Tolvanen <samitolvanen@google.com>
Mon, 22 Dec 2025 16:35:53 +0000 (16:35 +0000)
Remove the custom __modinit macro from kernel/params.c and instead use the
common __init_or_module macro from include/linux/module.h. Both provide the
same functionality.

Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
Reviewed-by: Aaron Tomlin <atomlin@atomlin.com>
Reviewed-by: Daniel Gomez <da.gomez@samsung.com>
Reviewed-by: Sami Tolvanen <samitolvanen@google.com>
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
kernel/params.c

index b96cfd693c9968012d42acb85611fee1acd47790..7c2242f64bf084a5b6ab7ff16e7d8dcd251da46e 100644 (file)
@@ -596,12 +596,6 @@ static ssize_t param_attr_store(const struct module_attribute *mattr,
 }
 #endif
 
-#ifdef CONFIG_MODULES
-#define __modinit
-#else
-#define __modinit __init
-#endif
-
 #ifdef CONFIG_SYSFS
 void kernel_param_lock(struct module *mod)
 {
@@ -626,9 +620,9 @@ EXPORT_SYMBOL(kernel_param_unlock);
  * create file in sysfs.  Returns an error on out of memory.  Always cleans up
  * if there's an error.
  */
-static __modinit int add_sysfs_param(struct module_kobject *mk,
-                                    const struct kernel_param *kp,
-                                    const char *name)
+static __init_or_module int add_sysfs_param(struct module_kobject *mk,
+                                           const struct kernel_param *kp,
+                                           const char *name)
 {
        struct module_param_attrs *new_mp;
        struct attribute **new_attrs;
@@ -761,7 +755,8 @@ void destroy_params(const struct kernel_param *params, unsigned num)
                        params[i].ops->free(params[i].arg);
 }
 
-struct module_kobject __modinit * lookup_or_create_module_kobject(const char *name)
+struct module_kobject * __init_or_module
+lookup_or_create_module_kobject(const char *name)
 {
        struct module_kobject *mk;
        struct kobject *kobj;