提交 ec65aafb 编写于 作者: J Johannes Berg 提交者: David S. Miller

netdev_alloc_pcpu_stats: use less common iterator variable

With the CPU iteration variable called 'i', it's relatively easy
to have variable shadowing which sparse will warn about. Avoid
that by renaming the variable to __cpu which is less likely to
be used in the surrounding context.
Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 60840429
...@@ -2025,10 +2025,10 @@ struct pcpu_sw_netstats { ...@@ -2025,10 +2025,10 @@ struct pcpu_sw_netstats {
({ \ ({ \
typeof(type) __percpu *pcpu_stats = alloc_percpu(type); \ typeof(type) __percpu *pcpu_stats = alloc_percpu(type); \
if (pcpu_stats) { \ if (pcpu_stats) { \
int i; \ int __cpu; \
for_each_possible_cpu(i) { \ for_each_possible_cpu(__cpu) { \
typeof(type) *stat; \ typeof(type) *stat; \
stat = per_cpu_ptr(pcpu_stats, i); \ stat = per_cpu_ptr(pcpu_stats, __cpu); \
u64_stats_init(&stat->syncp); \ u64_stats_init(&stat->syncp); \
} \ } \
} \ } \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册