浏览代码

netdev: set __percpu attribute on netdev_alloc_pcpu_stats

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>
stephen hemminger 11 年之前
父节点
当前提交
693350c2ff
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      include/linux/netdevice.h

+ 1 - 1
include/linux/netdevice.h

@@ -1812,7 +1812,7 @@ struct pcpu_sw_netstats {
 
 
 #define netdev_alloc_pcpu_stats(type)				\
 #define netdev_alloc_pcpu_stats(type)				\
 ({								\
 ({								\
-	typeof(type) *pcpu_stats = alloc_percpu(type);		\
+	typeof(type) __percpu *pcpu_stats = alloc_percpu(type); \
 	if (pcpu_stats)	{					\
 	if (pcpu_stats)	{					\
 		int i;						\
 		int i;						\
 		for_each_possible_cpu(i) {			\
 		for_each_possible_cpu(i) {			\