diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2013-04-17 03:18:28 -0400 |
---|---|---|
committer | Zhang Rui <rui.zhang@intel.com> | 2013-04-17 11:43:31 -0400 |
commit | 4f89038f177462dbd2fd911297fd004226176db7 (patch) | |
tree | 5b5fef33500baa34c4c5d7fba795c4f79c850676 /drivers/thermal/cpu_cooling.c | |
parent | d13cb03aef0c062dcdd16b411bd4c02c1574ff08 (diff) |
Thermal: cpufreq cooling: endian bug in cpufreq_get_max_state()
This code doesn't work on big endian systems because we're storing low
values in the high bits of the unsigned long. It makes it a very high
value instead.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Diffstat (limited to 'drivers/thermal/cpu_cooling.c')
-rw-r--r-- | drivers/thermal/cpu_cooling.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c index 5f5c780bcd90..768b508f0d69 100644 --- a/drivers/thermal/cpu_cooling.c +++ b/drivers/thermal/cpu_cooling.c | |||
@@ -303,12 +303,12 @@ static int cpufreq_get_max_state(struct thermal_cooling_device *cdev, | |||
303 | struct cpufreq_cooling_device *cpufreq_device = cdev->devdata; | 303 | struct cpufreq_cooling_device *cpufreq_device = cdev->devdata; |
304 | struct cpumask *mask = &cpufreq_device->allowed_cpus; | 304 | struct cpumask *mask = &cpufreq_device->allowed_cpus; |
305 | unsigned int cpu; | 305 | unsigned int cpu; |
306 | unsigned long count = 0; | 306 | unsigned int count = 0; |
307 | int ret; | 307 | int ret; |
308 | 308 | ||
309 | cpu = cpumask_any(mask); | 309 | cpu = cpumask_any(mask); |
310 | 310 | ||
311 | ret = get_property(cpu, 0, (unsigned int *)&count, GET_MAXL); | 311 | ret = get_property(cpu, 0, &count, GET_MAXL); |
312 | 312 | ||
313 | if (count > 0) | 313 | if (count > 0) |
314 | *state = count; | 314 | *state = count; |