]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ACPI: CPPC: Drop check for non zero perf ratio
authorMario Limonciello <mario.limonciello@amd.com>
Tue, 27 Aug 2024 18:50:45 +0000 (13:50 -0500)
committerMario Limonciello <mario.limonciello@amd.com>
Wed, 11 Sep 2024 15:23:22 +0000 (10:23 -0500)
perf_ratio is a u64 and SCHED_CAPACITY_SCALE is a large number.
Shifting by one will never have a zero value.

Drop the check.

Suggested-by: Gautham R. Shenoy <gautham.shenoy@amd.com>
Reviewed-by: Gautham R. Shenoy <gautham.sheoy@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
arch/x86/kernel/acpi/cppc.c

index 660cfeb6384ba53753884cb86e8abd6fd636b55a..e65c77afab318a6c0c8a67b5c6bf2c744ddb5a61 100644 (file)
@@ -91,13 +91,8 @@ static void amd_set_max_freq_ratio(void)
                return;
        }
 
-       perf_ratio = div_u64(numerator * SCHED_CAPACITY_SCALE, nominal_perf);
        /* midpoint between max_boost and max_P */
-       perf_ratio = (perf_ratio + SCHED_CAPACITY_SCALE) >> 1;
-       if (!perf_ratio) {
-               pr_debug("Non-zero highest/nominal perf values led to a 0 ratio\n");
-               return;
-       }
+       perf_ratio = (div_u64(numerator * SCHED_CAPACITY_SCALE, nominal_perf) + SCHED_CAPACITY_SCALE) >> 1;
 
        freq_invariance_set_perf_ratio(perf_ratio, false);
 }