From 027f90073af54d394f629f4f091a316b26beec67 Mon Sep 17 00:00:00 2001 From: Jesse Gross Date: Wed, 29 Dec 2010 11:42:13 -0800 Subject: [PATCH] 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 --- datapath/datapath.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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; -- 2.30.2