]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
cpufreq: CPPC: Do not return a value from populate_efficiency_class()
authorLifeng Zheng <zhenglifeng1@huawei.com>
Mon, 26 May 2025 11:30:56 +0000 (19:30 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 18 Jun 2025 19:03:52 +0000 (21:03 +0200)
The return value of populate_efficiency_class() is never needed and the
result of it doesn't affect the initialization of cppc_cpufreq.

It makes more sense to change it into a void function.

Signed-off-by: Lifeng Zheng <zhenglifeng1@huawei.com>
Link: https://patch.msgid.link/20250526113057.3086513-3-zhenglifeng1@huawei.com
[ rjw: Subject and changelog edits ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/cppc_cpufreq.c

index f3b5ea9fcbf514384f4fa13fbb982c822ff69958..c2be4b188a237c42d23dfa2079a707fbbc45a9e8 100644 (file)
@@ -480,7 +480,7 @@ static int cppc_get_cpu_cost(struct device *cpu_dev, unsigned long KHz,
        return 0;
 }
 
-static int populate_efficiency_class(void)
+static void populate_efficiency_class(void)
 {
        struct acpi_madt_generic_interrupt *gicc;
        DECLARE_BITMAP(used_classes, 256) = {};
@@ -495,7 +495,7 @@ static int populate_efficiency_class(void)
        if (bitmap_weight(used_classes, 256) <= 1) {
                pr_debug("Efficiency classes are all equal (=%d). "
                        "No EM registered", class);
-               return -EINVAL;
+               return;
        }
 
        /*
@@ -512,8 +512,6 @@ static int populate_efficiency_class(void)
                index++;
        }
        cppc_cpufreq_driver.register_em = cppc_cpufreq_register_em;
-
-       return 0;
 }
 
 static void cppc_cpufreq_register_em(struct cpufreq_policy *policy)
@@ -529,9 +527,8 @@ static void cppc_cpufreq_register_em(struct cpufreq_policy *policy)
 }
 
 #else
-static int populate_efficiency_class(void)
+static void populate_efficiency_class(void)
 {
-       return 0;
 }
 #endif