]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
kernel: param: rename locate_module_kobject
authorShyam Saini <shyamsaini@linux.microsoft.com>
Thu, 27 Feb 2025 18:49:27 +0000 (10:49 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 May 2025 07:44:06 +0000 (09:44 +0200)
[ Upstream commit bbc9462f0cb0c8917a4908e856731708f0cee910 ]

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>
Stable-dep-of: f95bbfe18512 ("drivers: base: handle module_kobject creation")
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/params.c

index 2d4a0564697e832bcb3e6e9bfe03533d1db0e709..8d48a6bfe68da4b7eba1efc69a622aed9c8a17d1 100644 (file)
@@ -759,7 +759,7 @@ void destroy_params(const struct kernel_param *params, unsigned num)
                        params[i].ops->free(params[i].arg);
 }
 
-static struct module_kobject * __init locate_module_kobject(const char *name)
+static struct module_kobject * __init lookup_or_create_module_kobject(const char *name)
 {
        struct module_kobject *mk;
        struct kobject *kobj;
@@ -801,7 +801,7 @@ static void __init kernel_add_sysfs_param(const char *name,
        struct module_kobject *mk;
        int err;
 
-       mk = locate_module_kobject(name);
+       mk = lookup_or_create_module_kobject(name);
        if (!mk)
                return;
 
@@ -872,7 +872,7 @@ static void __init version_sysfs_builtin(void)
        int err;
 
        for (vattr = __start___modver; vattr < __stop___modver; vattr++) {
-               mk = locate_module_kobject(vattr->module_name);
+               mk = lookup_or_create_module_kobject(vattr->module_name);
                if (mk) {
                        err = sysfs_create_file(&mk->kobj, &vattr->mattr.attr);
                        WARN_ON_ONCE(err);