Skip to content

Commit 3355ac2

Browse files
committed
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 <[email protected]> Reviewed-by: Gautham R. Shenoy <[email protected]> Signed-off-by: Mario Limonciello <[email protected]>
1 parent 6c09e3b commit 3355ac2

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

arch/x86/kernel/acpi/cppc.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,8 @@ static void amd_set_max_freq_ratio(void)
9191
return;
9292
}
9393

94-
perf_ratio = div_u64(numerator * SCHED_CAPACITY_SCALE, nominal_perf);
9594
/* midpoint between max_boost and max_P */
96-
perf_ratio = (perf_ratio + SCHED_CAPACITY_SCALE) >> 1;
97-
if (!perf_ratio) {
98-
pr_debug("Non-zero highest/nominal perf values led to a 0 ratio\n");
99-
return;
100-
}
95+
perf_ratio = (div_u64(numerator * SCHED_CAPACITY_SCALE, nominal_perf) + SCHED_CAPACITY_SCALE) >> 1;
10196

10297
freq_invariance_set_perf_ratio(perf_ratio, false);
10398
}

0 commit comments

Comments
 (0)