Commit 8120832d authored by Manfred Spraul's avatar Manfred Spraul Committed by Rafael J. Wysocki

ACPI: processor: thermal: avoid cpufreq_get_policy()

cpu_has_cpufreq() stores a 'struct cpufreq_policy' on the stack.
Unfortunately, with debugging options enabled, the structure can be
larger than 1024 bytes, which causes a compiler warning/error.

(actually observed: 1184 bytes).

Therefore: Switch to cpufreq_cpu_get().
Signed-off-by: default avatarManfred Spraul <manfred@colorfullife.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 87ebbb8c
...@@ -53,10 +53,17 @@ static int phys_package_first_cpu(int cpu) ...@@ -53,10 +53,17 @@ static int phys_package_first_cpu(int cpu)
static int cpu_has_cpufreq(unsigned int cpu) static int cpu_has_cpufreq(unsigned int cpu)
{ {
struct cpufreq_policy policy; struct cpufreq_policy *policy;
if (!acpi_processor_cpufreq_init || cpufreq_get_policy(&policy, cpu))
if (!acpi_processor_cpufreq_init)
return 0; return 0;
policy = cpufreq_cpu_get(cpu);
if (policy) {
cpufreq_cpu_put(policy);
return 1; return 1;
}
return 0;
} }
static int cpufreq_get_max_state(unsigned int cpu) static int cpufreq_get_max_state(unsigned int cpu)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment