summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/processor_thermal.c
diff options
context:
space:
mode:
authorManfred Spraul <manfred@colorfullife.com>2021-12-22 15:09:31 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2021-12-30 19:39:34 +0100
commit8120832d8f82aa7316c578fbccf11e385a5b3601 (patch)
tree6efdba329e3a9e133f722b2af6dc55d1dc7eef55 /drivers/acpi/processor_thermal.c
parentACPI: processor: idle: Only flush cache on entering C3 (diff)
downloadlinux-8120832d8f82aa7316c578fbccf11e385a5b3601.tar.xz
linux-8120832d8f82aa7316c578fbccf11e385a5b3601.zip
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>
Diffstat (limited to 'drivers/acpi/processor_thermal.c')
-rw-r--r--drivers/acpi/processor_thermal.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/acpi/processor_thermal.c b/drivers/acpi/processor_thermal.c
index a3d34e3f9f94..d8b2dfcd59b5 100644
--- a/drivers/acpi/processor_thermal.c
+++ b/drivers/acpi/processor_thermal.c
@@ -53,10 +53,17 @@ static int phys_package_first_cpu(int cpu)
static int cpu_has_cpufreq(unsigned int cpu)
{
- struct cpufreq_policy policy;
- if (!acpi_processor_cpufreq_init || cpufreq_get_policy(&policy, cpu))
+ struct cpufreq_policy *policy;
+
+ if (!acpi_processor_cpufreq_init)
return 0;
- return 1;
+
+ policy = cpufreq_cpu_get(cpu);
+ if (policy) {
+ cpufreq_cpu_put(policy);
+ return 1;
+ }
+ return 0;
}
static int cpufreq_get_max_state(unsigned int cpu)