From 76374783455031bc6d997c8bed4cbce9e7a7a509 Mon Sep 17 00:00:00 2001 From: Dave Jones Date: Thu, 4 Sep 2003 04:38:00 +0100 Subject: [PATCH] [CPUFREQ] Clean up clock_ratio calculation. --- arch/i386/kernel/cpu/cpufreq/longhaul.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/arch/i386/kernel/cpu/cpufreq/longhaul.c b/arch/i386/kernel/cpu/cpufreq/longhaul.c index ced5f1e67a587..9b851aea777b3 100644 --- a/arch/i386/kernel/cpu/cpufreq/longhaul.c +++ b/arch/i386/kernel/cpu/cpufreq/longhaul.c @@ -303,10 +303,10 @@ static void longhaul_setstate (unsigned int clock_ratio_index) union msr_longhaul longhaul; union msr_bcr2 bcr2; - if (clock_ratio[clock_ratio_index] == -1) + mult = clock_ratio[clock_ratio_index]; + if (mult == -1) return; - mult = clock_ratio[clock_ratio_index]; speed = calc_speed (mult, fsb); if ((speed > highest_speed) || (speed < lowest_speed)) return; @@ -450,12 +450,14 @@ static int __init longhaul_get_ranges (void) if(!longhaul_table) return -ENOMEM; - for (j=0; (j maxmult) || ((unsigned int)clock_ratio[j] < minmult)) + if (ratio > maxmult || ratio < minmult) continue; - longhaul_table[k].frequency = calc_speed (clock_ratio[j], fsb); + longhaul_table[k].frequency = calc_speed (ratio, fsb); longhaul_table[k].index = (j << 8); k++; } -- 2.53.0