]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
kernel: globalize lookup_or_create_module_kobject()
authorShyam Saini <shyamsaini@linux.microsoft.com>
Thu, 27 Feb 2025 18:49:29 +0000 (10:49 -0800)
committerPetr Pavlu <petr.pavlu@suse.com>
Wed, 16 Apr 2025 12:54:53 +0000 (14:54 +0200)
lookup_or_create_module_kobject() is marked as static and __init,
to make it global drop static keyword.
Since this function can be called from non-init code, use __modinit
instead of __init, __modinit marker will make it __init if
CONFIG_MODULES is not defined.

Suggested-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Shyam Saini <shyamsaini@linux.microsoft.com>
Link: https://lore.kernel.org/r/20250227184930.34163-4-shyamsaini@linux.microsoft.com
Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
include/linux/module.h
kernel/params.c

index d94b196d5a34e104d81308df4b150452eb96cdc9..b3329110d6686f315ae35335dced45e7eae6a130 100644 (file)
@@ -162,6 +162,8 @@ extern void cleanup_module(void);
 #define __INITRODATA_OR_MODULE __INITRODATA
 #endif /*CONFIG_MODULES*/
 
+struct module_kobject *lookup_or_create_module_kobject(const char *name);
+
 /* Generic info of form tag = "info" */
 #define MODULE_INFO(tag, info) __MODULE_INFO(tag, tag, info)
 
index 787662663e3489ac9a2d246531315e766f4ec75e..e668fc90b83ec57d7cd904f960d7c2dcf3802b5d 100644 (file)
@@ -760,7 +760,7 @@ void destroy_params(const struct kernel_param *params, unsigned num)
                        params[i].ops->free(params[i].arg);
 }
 
-static struct module_kobject * __init lookup_or_create_module_kobject(const char *name)
+struct module_kobject __modinit * lookup_or_create_module_kobject(const char *name)
 {
        struct module_kobject *mk;
        struct kobject *kobj;