datapath: Add usage of __percpu annotation.
authorJesse Gross <jesse@nicira.com>
Sat, 4 Dec 2010 19:39:53 +0000 (11:39 -0800)
committerJesse Gross <jesse@nicira.com>
Mon, 13 Dec 2010 21:40:00 +0000 (13:40 -0800)
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@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
datapath/datapath.h
datapath/vport.h

index c55e205..66ade3e 100644 (file)
@@ -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;
index b98c461..fb3a3e3 100644 (file)
@@ -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;