linux-next: percpu tree build warning
Subsystems (2)
Hi all,
Today's linux-next build (powerpc ppc64_defconfig) produced this warning:
drivers/net/loopback.c: In function 'loopback_get_stats':drivers/net/loopback.c:109: warning: initialization discards qualifiers from pointer target type
The line in question is:
lb_stats = per_cpu_ptr(pcpu_lstats, i);
Where "lb_stats" and "pcpu_lstats" are both "const struct pcpu_lstats *". I guess this is because of __verify_pcpu_ptr().
Signature · 3 lines
Cheers, Stephen Rothwell [email protected] http://www.canb.auug.org.au/~sfr/
Quoted 7 lines · Stephen Rothwell
Hi all,
Today's linux-next build (powerpc
ppc64_defconfig) produced this warning:
drivers/net/loopback.c: In function 'loopback_get_stats':drivers/net/loopback.c:109: warning: initialization discards qualifiers from pointer target type
Quoted 6 lines
The line in question is:
lb_stats = per_cpu_ptr(pcpu_lstats, i);Where "
lb_stats" and "pcpu_lstats" are both "const structpcpu_lstats*". I guess this is because of__verify_pcpu_ptr().
hmm... pcpu_lstats needs to be correctly qualified I guess.
Tejun Heo
maintainerPATCH 1/1 percpu: remove compile warnings caused by __verify_pcpu_ptr()
In reply to Stephen RothwellIf percpu pointer is const, __verify_pcpu_ptr() triggers warnings like the following.
drivers/net/loopback.c: In function 'loopback_get_stats':
drivers/net/loopback.c:109: warning: initialization discards qualifiers from pointer target type
Fix it by adding const to the verification target pointer used in __verify_pcpu_ptr().
---
Sorry about the delay. Patch committed to percpu#for-next.
Thanks.
include/linux/percpu-defs.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
include/linux/percpu-defs.h +1 -1
@@ -24,7 +24,7 @@* input parameter is a percpu pointer. */ #define __verify_pcpu_ptr (ptr) do { \ - void __percpu *__vpp_verify = (typeof(ptr))NULL; \ + const void __percpu *__vpp_verify = (typeof(ptr))NULL; \ (void)__vpp_verify; \ } while (0)
Signature · 1 line
1.6.4.2