Skip to content

Commit 7c76c81

Browse files
Shyam Sainipetrpavlu
authored andcommitted
kernel: globalize lookup_or_create_module_kobject()
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>
1 parent 1c7777f commit 7c76c81

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

include/linux/module.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,8 @@ extern void cleanup_module(void);
162162
#define __INITRODATA_OR_MODULE __INITRODATA
163163
#endif /*CONFIG_MODULES*/
164164

165+
struct module_kobject *lookup_or_create_module_kobject(const char *name);
166+
165167
/* Generic info of form tag = "info" */
166168
#define MODULE_INFO(tag, info) __MODULE_INFO(tag, tag, info)
167169

kernel/params.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,7 @@ void destroy_params(const struct kernel_param *params, unsigned num)
760760
params[i].ops->free(params[i].arg);
761761
}
762762

763-
static struct module_kobject * __init lookup_or_create_module_kobject(const char *name)
763+
struct module_kobject __modinit * lookup_or_create_module_kobject(const char *name)
764764
{
765765
struct module_kobject *mk;
766766
struct kobject *kobj;

0 commit comments

Comments
 (0)