[ovs-dev] [PATCH 04/12] datapath: Add usage of __percpu annotation.

Jesse Gross jesse at nicira.com
Sun Dec 12 20:52:59 UTC 2010


Sparse can warn if percpu pointers are incorrectly directly
dereference.  This adds the annotation where we declare percpu
pointers.

Signed-off-by: Jesse Gross <jesse at nicira.com>
---
 datapath/datapath.h |    2 +-
 datapath/vport.h    |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/datapath/datapath.h b/datapath/datapath.h
index c55e205..66ade3e 100644
--- a/datapath/datapath.h
+++ b/datapath/datapath.h
@@ -96,7 +96,7 @@ struct datapath {
 	struct list_head port_list;
 
 	/* Stats. */
-	struct dp_stats_percpu *stats_percpu;
+	struct dp_stats_percpu __percpu *stats_percpu;
 
 	/* sFlow Sampling */
 	unsigned int sflow_probability;
diff --git a/datapath/vport.h b/datapath/vport.h
index b98c461..fb3a3e3 100644
--- a/datapath/vport.h
+++ b/datapath/vport.h
@@ -115,7 +115,7 @@ struct vport {
 	struct hlist_node hash_node;
 	const struct vport_ops *ops;
 
-	struct vport_percpu_stats *percpu_stats;
+	struct vport_percpu_stats __percpu *percpu_stats;
 
 	spinlock_t stats_lock;
 	struct vport_err_stats err_stats;
-- 
1.7.1





More information about the dev mailing list