Skip to contentSkip to conversation

netdev: set __percpu attribute on netdev_alloc_pcpu_stats

PATCH Applied Stephen Hemminger 3 participants 3 messages Mar 10, 2014 – Mar 11, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

include/linux/netdevice.h +1 -1
@@ -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) {			\
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Stephen Hemminger

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.

Thanks for the fix.

maintainer Applied
#2 lore raw
In reply to Stephen Hemminger

From: Stephen Hemminger <[email protected]>
Date: Mon, 10 Mar 2014 09:41:46 -0700

Quoted 7 lines

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.

Applied.