* [PATCH] make cpu_has_cpufreq() work
@ 2005-12-21 3:46 Dirk Mueller
0 siblings, 0 replies; only message in thread
From: Dirk Mueller @ 2005-12-21 3:46 UTC (permalink / raw)
To: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
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 <trenn-l3A5Bk7waGM@public.gmane.org>
Signed-off-by: Dirk Mueller <dmueller-IBi9RG/b67k@public.gmane.org>
--- 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)
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-12-21 3:46 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-21 3:46 [PATCH] make cpu_has_cpufreq() work Dirk Mueller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.