Skip to content

Commit db441bd

Browse files
gghhPeter Zijlstra
authored andcommitted
x86, sched: Move check for CPU type to caller function
Improve readability of the function intel_set_max_freq_ratio() by moving the check for KNL CPUs there, together with checks for GLM and SKX. Signed-off-by: Giovanni Gherdovich <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Acked-by: Rafael J. Wysocki <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent b56e7d4 commit db441bd

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

arch/x86/kernel/smpboot.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1877,9 +1877,6 @@ static bool knl_set_max_freq_ratio(u64 *base_freq, u64 *turbo_freq,
18771877
int err, i;
18781878
u64 msr;
18791879

1880-
if (!x86_match_cpu(has_knl_turbo_ratio_limits))
1881-
return false;
1882-
18831880
err = rdmsrl_safe(MSR_PLATFORM_INFO, base_freq);
18841881
if (err)
18851882
return false;
@@ -1977,7 +1974,8 @@ static bool intel_set_max_freq_ratio(void)
19771974
skx_set_max_freq_ratio(&base_freq, &turbo_freq, 1))
19781975
goto out;
19791976

1980-
if (knl_set_max_freq_ratio(&base_freq, &turbo_freq, 1))
1977+
if (x86_match_cpu(has_knl_turbo_ratio_limits) &&
1978+
knl_set_max_freq_ratio(&base_freq, &turbo_freq, 1))
19811979
goto out;
19821980

19831981
if (x86_match_cpu(has_skx_turbo_ratio_limits) &&

0 commit comments

Comments
 (0)