Skip to content

Commit

Permalink
netdev: set __percpu attribute on netdev_alloc_pcpu_stats
Browse files Browse the repository at this point in the history
This patch fixes sparse warnings in vlan driver.
It propagates the sparse __percpu attribute from alloc_percpu
into netdev_alloc_pcpu_stats. I expect it may trigger additional
sparse warnings from other drivers that are missing the __percpu
attribute.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Cong Wang <cwang@twopensource.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
stephen hemminger authored and David S. Miller committed Mar 11, 2014
1 parent 090f116 commit 693350c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/linux/netdevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -1812,7 +1812,7 @@ struct pcpu_sw_netstats {

#define netdev_alloc_pcpu_stats(type) \
({ \
typeof(type) *pcpu_stats = alloc_percpu(type); \
typeof(type) __percpu *pcpu_stats = alloc_percpu(type); \
if (pcpu_stats) { \
int i; \
for_each_possible_cpu(i) { \
Expand Down

0 comments on commit 693350c

Please sign in to comment.