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 c55e2059409274ac8c50380f3a20784a45641369..66ade3e11c1910618311d60786f6358e301eacb7 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 b98c461ed3e9a0cd3de48bcf8742f58e99989d08..fb3a3e37f31afdba3073be08cd277b86fa359cf3 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;