From: Jesse Gross Date: Wed, 29 Dec 2010 19:42:13 +0000 (-0800) Subject: datapath: Drop constness of datapath pointers. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=027f90073af54d394f629f4f091a316b26beec67;p=openvswitch datapath: Drop constness of datapath pointers. 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 Signed-off-by: Jesse Gross Acked-by: Ben Pfaff --- diff --git a/datapath/datapath.c b/datapath/datapath.c index d56bbf70..01b3025d 100644 --- a/datapath/datapath.c +++ b/datapath/datapath.c @@ -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;