Skip to contentSkip to conversation

cpufreq bugfixes

PATCH New Dominik Brodowski 1 participant 1 message Sep 29, 2002

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cpufreq bugfixes

Hi Linus,

Thanks for merging cpufreq. Please apply these bugfixes, too.

- incorrect pointer calculation spotted by Gerald Britton
- speedstep.c cleanup (Gerald Britton)

Dominik

arch/i386/kernel/cpu/cpufreq/elanfreq.c +1 -1
diff -ruN linux-2539cpufreq/arch/i386/kernel/cpu/cpufreq/elanfreq.c linux/arch/i386/kernel/cpu/cpufreq/elanfreq.c
@@ -290,7 +290,7 @@
 	if (!driver)
 		return -ENOMEM;
 
-	driver->policy = (struct cpufreq_policy *) (driver + sizeof(struct cpufreq_driver));
+	driver->policy = (struct cpufreq_policy *) (driver + 1);
 
 	if (!max_freq)
 		max_freq = elanfreq_get_cpu_frequency();
arch/i386/kernel/cpu/cpufreq/longhaul.c +2 -2
diff -ruN linux-2539cpufreq/arch/i386/kernel/cpu/cpufreq/longhaul.c linux/arch/i386/kernel/cpu/cpufreq/longhaul.c
@@ -1,5 +1,5 @@
 /*
- *  $Id: longhaul.c,v 1.70 2002/09/12 10:22:17 db Exp $
+ *  $Id: longhaul.c,v 1.72 2002/09/29 23:43:10 db Exp $
  *
  *  (C) 2001  Dave Jones. <[email protected]>
  *  (C) 2002  Padraig Brady. <[email protected]>
@@ -771,7 +771,7 @@
 	if (!driver)
 		return -ENOMEM;
 
-	driver->policy = (struct cpufreq_policy *) (driver + sizeof(struct cpufreq_driver));
+	driver->policy = (struct cpufreq_policy *) (driver + 1);
 
 #ifdef CONFIG_CPU_FREQ_24_API
 	driver->cpu_min_freq    = (unsigned int) lowest_speed;
arch/i386/kernel/cpu/cpufreq/longrun.c +2 -2
diff -ruN linux-2539cpufreq/arch/i386/kernel/cpu/cpufreq/longrun.c linux/arch/i386/kernel/cpu/cpufreq/longrun.c
@@ -1,5 +1,5 @@
 /*
- *  $Id: longrun.c,v 1.10 2002/09/22 09:01:41 db Exp $
+ *  $Id: longrun.c,v 1.12 2002/09/29 23:43:10 db Exp $
  *
  * (C) 2002  Dominik Brodowski <[email protected]>
  *
@@ -241,7 +241,7 @@
 	if (!driver)
 		return -ENOMEM;
 
-	driver->policy = (struct cpufreq_policy *) (driver + sizeof(struct cpufreq_driver));
+	driver->policy = (struct cpufreq_policy *) (driver + 1);
 
 	if (longrun_determine_freqs(&longrun_low_freq, &longrun_high_freq)) {
 		kfree(driver);
arch/i386/kernel/cpu/cpufreq/p4-clockmod.c +1 -1
diff -ruN linux-2539cpufreq/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c linux/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c
@@ -225,7 +225,7 @@
 	if (!driver)
 		return -ENOMEM;
 
-	driver->policy = (struct cpufreq_policy *) (driver + sizeof(struct cpufreq_driver));
+	driver->policy = (struct cpufreq_policy *) (driver + 1);
 
 	if (!stock_freq)
 		stock_freq = cpu_khz;
arch/i386/kernel/cpu/cpufreq/powernow-k6.c +2 -2
diff -ruN linux-2539cpufreq/arch/i386/kernel/cpu/cpufreq/powernow-k6.c linux/arch/i386/kernel/cpu/cpufreq/powernow-k6.c
@@ -1,5 +1,5 @@
 /*
- *  $Id: powernow-k6.c,v 1.31 2002/09/21 09:05:29 db Exp $
+ *  $Id: powernow-k6.c,v 1.33 2002/09/29 23:43:11 db Exp $
  *  This file was part of Powertweak Linux (http://powertweak.sf.net)
  *  and is shared with the Linux Kernel module.
  *
@@ -239,7 +239,7 @@
 		release_region (POWERNOW_IOPORT, 16);
 		return -ENOMEM;
 	}
-	driver->policy = (struct cpufreq_policy *) (driver + sizeof(struct cpufreq_driver));
+	driver->policy = (struct cpufreq_policy *) (driver + 1);
 
 #ifdef CONFIG_CPU_FREQ_24_API
 	driver->cpu_min_freq     = busfreq * 20;
arch/i386/kernel/cpu/cpufreq/speedstep.c +38 -41

193 lines not on this page · raw message

arch/i386/kernel/time.c +2 -2
diff -ruN linux-2539cpufreq/arch/i386/kernel/time.c linux/arch/i386/kernel/time.c
@@ -626,7 +626,7 @@
 		}
 		for (i=0; i<NR_CPUS; i++)
 			if ((freq->cpu == CPUFREQ_ALL_CPUS) || (freq->cpu == i))
-				cpu_data[i].loops_per_jiffy = cpufreq_scale(loops_per_jiffy, freq->old, freq->new);
+				cpu_data[i].loops_per_jiffy = cpufreq_scale(cpu_data[i].loops_per_jiffy, freq->old, freq->new);
 		break;
 
 	case CPUFREQ_POSTCHANGE:
@@ -637,7 +637,7 @@
 		}
 		for (i=0; i<NR_CPUS; i++)
 			if ((freq->cpu == CPUFREQ_ALL_CPUS) || (freq->cpu == i))
-				cpu_data[i].loops_per_jiffy = cpufreq_scale(loops_per_jiffy, freq->old, freq->new);
+				cpu_data[i].loops_per_jiffy = cpufreq_scale(cpu_data[i].loops_per_jiffy, freq->old, freq->new);
 		break;
 	}