Skip to content

Commit 8120832

Browse files
manfred-colorfurafaeljw
authored andcommitted
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: Manfred Spraul <manfred@colorfullife.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 87ebbb8 commit 8120832

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

drivers/acpi/processor_thermal.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,17 @@ static int phys_package_first_cpu(int cpu)
5353

5454
static int cpu_has_cpufreq(unsigned int cpu)
5555
{
56-
struct cpufreq_policy policy;
57-
if (!acpi_processor_cpufreq_init || cpufreq_get_policy(&policy, cpu))
56+
struct cpufreq_policy *policy;
57+
58+
if (!acpi_processor_cpufreq_init)
5859
return 0;
59-
return 1;
60+
61+
policy = cpufreq_cpu_get(cpu);
62+
if (policy) {
63+
cpufreq_cpu_put(policy);
64+
return 1;
65+
}
66+
return 0;
6067
}
6168

6269
static int cpufreq_get_max_state(unsigned int cpu)

0 commit comments

Comments
 (0)