|
From: Dirk M. <dmu...@su...> - 2005-12-21 03:46:56
|
Hi,
it seems to me the return values of cpu_has_cpufreq in processor_thermal.c are
reversed. all callers check for if(!cpu_has_cpufreq()) return -ENODEV, which
indicates that it expects a return value of 0 for error, and nonzero for
success.
However the current implementation gets that reversed. the patch below fixes
it. Spotted by Thomas Renninger, and fixes the ACPI thermal code never
actually speedstepping the CPU when it overheats.
Signed-off-by: Thomas Renninger <tr...@su...>
Signed-off-by: Dirk Mueller <dmu...@su...>
--- processor_thermal.c.orig 2005-12-21 00:18:06.000000000 +0100
+++ processor_thermal.c 2005-12-21 00:18:23.000000000 +0100
@@ -102,8 +102,8 @@ static int cpu_has_cpufreq(unsigned int
{
struct cpufreq_policy policy;
if (!acpi_thermal_cpufreq_is_init || cpufreq_get_policy(&policy, cpu))
- return -ENODEV;
- return 0;
+ return 0;
+ return 1;
}
static int acpi_thermal_cpufreq_increase(unsigned int cpu)
|