提交 4f89038f 编写于 作者: D Dan Carpenter 提交者: Zhang Rui

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: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NZhang Rui <rui.zhang@intel.com>
上级 d13cb03a
......@@ -303,12 +303,12 @@ static int cpufreq_get_max_state(struct thermal_cooling_device *cdev,
struct cpufreq_cooling_device *cpufreq_device = cdev->devdata;
struct cpumask *mask = &cpufreq_device->allowed_cpus;
unsigned int cpu;
unsigned long count = 0;
unsigned int count = 0;
int ret;
cpu = cpumask_any(mask);
ret = get_property(cpu, 0, (unsigned int *)&count, GET_MAXL);
ret = get_property(cpu, 0, &count, GET_MAXL);
if (count > 0)
*state = count;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册