Skip to content

Commit

Permalink
percpu: remove compile warnings caused by __verify_pcpu_ptr()
Browse files Browse the repository at this point in the history
If 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().

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
  • Loading branch information
Tejun Heo committed Dec 8, 2009
1 parent 545695f commit 8543859
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/linux/percpu-defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 8543859

Please sign in to comment.