x86: sparse warning in cpufreq/powernow-k8.c
PATCH 1/3 x86: sparse warning in cpufreq/powernow-k8.c
Nested per_cpu accessors will shadow the internal __ptr variable. Use a temporary first_core variable.
arch/x86/kernel/cpu/cpufreq/powernow-k8.c:1239:9: warning: symbol '__ptr' shadows an earlier one arch/x86/kernel/cpu/cpufreq/powernow-k8.c:1239:9: originally declared here
--- arch/x86/kernel/cpu/cpufreq/powernow-k8.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
arch/x86/kernel/cpu/cpufreq/powernow-k8.c +2 -1
@@ -1234,9 +1234,10 @@ static unsigned int powernowk8_get (unsigned int cpu) {struct powernow_k8_data *data;cpumask_t oldmask = current->cpus_allowed; +unsigned int first_core =first_cpu (per_cpu (cpu_core_map, cpu));unsigned int khz =0 ; - data =per_cpu (powernow_data,first_cpu (per_cpu (cpu_core_map, cpu))); + data =per_cpu (powernow_data, first_core);if (!data)return -EINVAL ;
Signature · 1 line
1.5.4.1189.g38fd5
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 4 lines · Dave Jones
Quoted 3 lines · Harvey Harrison
Nested
per_cpuaccessors will shadow the internal__ptrvariable. Use a temporaryfirst_corevariable.
Quoted 9 lines
Quoted 4 lines
arch/x86/kernel/cpu/cpufreq/powernow-k8.c:1239:9: warning: symbol '__ptr' shadows an earlier onearch/x86/kernel/cpu/cpufreq/powernow-k8.c:1239:9: originally declared hereSigned-off-by Harvey Harrison <[email protected]>Already fixed in cpufreq.git
(Please also Cc me on cpufreq patches, thanks)
Sorry about that, I've been sending Ingo a bunch of x86 patches, didn't think to look further than that. Will keep in mind.
Harvey