datapath: Drop constness of datapath pointers.
authorJesse Gross <jesse@nicira.com>
Wed, 29 Dec 2010 19:42:13 +0000 (11:42 -0800)
committerJesse Gross <jesse@nicira.com>
Thu, 30 Dec 2010 17:35:53 +0000 (09:35 -0800)
A few places marked struct datapath pointers as const since they
didn't expect to make modifications.  However, when compiled with
lockdep the datapath mutex pointer is passed to lockdep_is_held(),
which has a non-const argument.  That provoked warnings about
casting away the const, so this drops the const from the original
pointers.

Reported-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
datapath/datapath.c

index d56bbf702acc63d741538a611d1b71b4ef0ccbb5..01b3025d9d5d1297322f74ed562962af24bf1546 100644 (file)
@@ -94,14 +94,13 @@ static struct datapath *get_dp_locked(int dp_idx)
        return dp;
 }
 
-static struct tbl *get_table_protected(const struct datapath *dp)
+static struct tbl *get_table_protected(struct datapath *dp)
 {
        return rcu_dereference_protected(dp->table,
                                         lockdep_is_held(&dp->mutex));
 }
 
-static struct vport *get_vport_protected(const struct datapath *dp,
-                                        u16 port_no)
+static struct vport *get_vport_protected(struct datapath *dp, u16 port_no)
 {
        return rcu_dereference_protected(dp->ports[port_no],
                                         lockdep_is_held(&dp->mutex));
@@ -128,7 +127,7 @@ static int dp_fill_ifinfo(struct sk_buff *skb,
                          const struct vport *port,
                          int event, unsigned int flags)
 {
-       const struct datapath *dp = port->dp;
+       struct datapath *dp = port->dp;
        int ifindex = vport_get_ifindex(port);
        int iflink = vport_get_iflink(port);
        struct ifinfomsg *hdr;