Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Shyam Saini and committed by
Petr Pavlu
7c76c813 1c7777fe

+3 -1
+2
include/linux/module.h
··· 162 162 #define __INITRODATA_OR_MODULE __INITRODATA 163 163 #endif /*CONFIG_MODULES*/ 164 164 165 + struct module_kobject *lookup_or_create_module_kobject(const char *name); 166 + 165 167 /* Generic info of form tag = "info" */ 166 168 #define MODULE_INFO(tag, info) __MODULE_INFO(tag, tag, info) 167 169
+1 -1
kernel/params.c
··· 760 760 params[i].ops->free(params[i].arg); 761 761 } 762 762 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) 764 764 { 765 765 struct module_kobject *mk; 766 766 struct kobject *kobj;