Skip to content

Commit bbc9462

Browse files
Shyam Sainipetrpavlu
authored andcommitted
kernel: param: rename locate_module_kobject
The locate_module_kobject() function looks up an existing module_kobject for a given module name. If it cannot find the corresponding module_kobject, it creates one for the given name. This commit renames locate_module_kobject() to lookup_or_create_module_kobject() to better describe its operations. This doesn't change anything functionality wise. Suggested-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Signed-off-by: Shyam Saini <shyamsaini@linux.microsoft.com> Link: https://lore.kernel.org/r/20250227184930.34163-2-shyamsaini@linux.microsoft.com Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
1 parent 8ffd015 commit bbc9462

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

kernel/params.c

Lines changed: 3 additions & 3 deletions
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 locate_module_kobject(const char *name)
763+
static struct module_kobject * __init lookup_or_create_module_kobject(const char *name)
764764
{
765765
struct module_kobject *mk;
766766
struct kobject *kobj;
@@ -802,7 +802,7 @@ static void __init kernel_add_sysfs_param(const char *name,
802802
struct module_kobject *mk;
803803
int err;
804804

805-
mk = locate_module_kobject(name);
805+
mk = lookup_or_create_module_kobject(name);
806806
if (!mk)
807807
return;
808808

@@ -873,7 +873,7 @@ static void __init version_sysfs_builtin(void)
873873
int err;
874874

875875
for (vattr = __start___modver; vattr < __stop___modver; vattr++) {
876-
mk = locate_module_kobject(vattr->module_name);
876+
mk = lookup_or_create_module_kobject(vattr->module_name);
877877
if (mk) {
878878
err = sysfs_create_file(&mk->kobj, &vattr->mattr.attr);
879879
WARN_ON_ONCE(err);

0 commit comments

Comments
 (0)