diff options
author | Mario Limonciello <mario.limonciello@amd.com> | 2024-08-27 13:50:45 -0500 |
---|---|---|
committer | Mario Limonciello <mario.limonciello@amd.com> | 2024-09-11 10:23:22 -0500 |
commit | 3355ac2541052154b6ca0b1263be5bf49dfa0158 (patch) | |
tree | e7c9bfe5d149927944094b538547f6f5b5dda10f /arch | |
parent | 6c09e3b445a1a647a5b57ea6afd23e846225dd8f (diff) |
ACPI: CPPC: Drop check for non zero perf ratio
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>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/acpi/cppc.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/arch/x86/kernel/acpi/cppc.c b/arch/x86/kernel/acpi/cppc.c index 660cfeb6384b..e65c77afab31 100644 --- a/arch/x86/kernel/acpi/cppc.c +++ b/arch/x86/kernel/acpi/cppc.c @@ -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); } |