Skip to content

Commit e5bc44e

Browse files
vingu-linaroIngo Molnar
authored andcommitted
arch/topology: Fix variable naming to avoid shadowing
Using 'hw_pressure' for local variable name is confusing in regard to the per-CPU 'hw_pressure' variable that uses the same name: include/linux/arch_topology.h:DECLARE_PER_CPU(unsigned long, hw_pressure); ... which puts it into a global scope for all code that includes <linux/topology.h>, shadowing the local variable. Rename it to avoid compiler confusion & Sparse warnings. [ mingo: Expanded the changelog. ] Reported-by: kernel test robot <[email protected]> Signed-off-by: Vincent Guittot <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Reviewed-by: Lukasz Luba <[email protected]> Reviewed-by: Konrad Dybcio <[email protected]> Acked-by: Sudeep Holla <[email protected]> Cc: Linus Torvalds <[email protected]> Link: https://lore.kernel.org/r/[email protected] Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Fixes: d4dbc99 ("sched/cpufreq: Rename arch_update_thermal_pressure() => arch_update_hw_pressure()") Tested-by: Konrad Dybcio <[email protected]> # QC SM8550 QRD
1 parent 9776dd3 commit e5bc44e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/base/arch_topology.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ DEFINE_PER_CPU(unsigned long, hw_pressure);
179179
void topology_update_hw_pressure(const struct cpumask *cpus,
180180
unsigned long capped_freq)
181181
{
182-
unsigned long max_capacity, capacity, hw_pressure;
182+
unsigned long max_capacity, capacity, pressure;
183183
u32 max_freq;
184184
int cpu;
185185

@@ -196,12 +196,12 @@ void topology_update_hw_pressure(const struct cpumask *cpus,
196196
else
197197
capacity = mult_frac(max_capacity, capped_freq, max_freq);
198198

199-
hw_pressure = max_capacity - capacity;
199+
pressure = max_capacity - capacity;
200200

201-
trace_hw_pressure_update(cpu, hw_pressure);
201+
trace_hw_pressure_update(cpu, pressure);
202202

203203
for_each_cpu(cpu, cpus)
204-
WRITE_ONCE(per_cpu(hw_pressure, cpu), hw_pressure);
204+
WRITE_ONCE(per_cpu(hw_pressure, cpu), pressure);
205205
}
206206
EXPORT_SYMBOL_GPL(topology_update_hw_pressure);
207207

0 commit comments

Comments
 (0)