]> git.neil.brown.name Git - history.git/commitdiff
[CPUFREQ] Fix longhauls speed calculations.
authorDave Jones <davej@redhat.com>
Fri, 10 Oct 2003 21:57:10 +0000 (22:57 +0100)
committerDave Jones <davej@redhat.com>
Fri, 10 Oct 2003 21:57:10 +0000 (22:57 +0100)
We got half multipliers horribly wrong, which made us think we could
clock the CPU much higher than we actually could.

arch/i386/kernel/cpu/cpufreq/longhaul.c

index 4691bb7818ddbdce42b846548717b48d855f7476..5b6070c1fefe8549f8c030e01e624dc784fc4a46 100644 (file)
@@ -63,7 +63,11 @@ static struct cpufreq_frequency_table *longhaul_table;
 
 static unsigned int calc_speed (int mult, int fsb)
 {
-       return ((mult/10)*fsb) + ((mult%10)*(fsb/2));
+       int mhz;
+       mhz = (mult/10)*fsb;
+       if (mult%10)
+               mhz += fsb/2;
+       return mhz;
 }