Skip to content

Commit

Permalink
ACPI: processor: thermal: avoid cpufreq_get_policy()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
  • Loading branch information
manfred-colorfu authored and rafaeljw committed Dec 30, 2021
1 parent 87ebbb8 commit 8120832
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions drivers/acpi/processor_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8120832

Please sign in to comment.