On Wed, Jun 08, 2016 at 08:01:39PM -0500, Ryan Moats wrote:
> From: "RYAN D. MOATS" <rmo...@us.ibm.com>
> 
> This is preparatory to making physical_run and lflow_run process
> incrementally as changes to the data in these structures control
> that processing.
> 
> Signed-off-by: RYAN D. MOATS <rmo...@us.ibm.com>

Thanks for the patch.

I folded in the following change and applied this to master.  The
changes I made were to reduce the number of "bare casts" and to put all
of the mcgroup-related declarations together.

I noticed that nothing calls lport_index_reset() or
mcgroup_index_reset().  Maybe some upcoming patch will add calls.

--8<--------------------------cut here-------------------------->8--

diff --git a/ovn/controller/lport.c b/ovn/controller/lport.c
index 461cabd..2ce6387 100644
--- a/ovn/controller/lport.c
+++ b/ovn/controller/lport.c
@@ -33,7 +33,6 @@ struct lport {
 };
 
 static bool full_lport_rebuild = false;
-static bool full_mc_rebuild = false;
 
 void
 lport_index_reset(void)
@@ -52,12 +51,13 @@ lport_index_init(struct lport_index *lports)
 void
 lport_index_remove(struct lport_index *lports, const struct uuid *uuid)
 {
-    const struct lport *port = lport_lookup_by_uuid(lports, uuid);
+    const struct lport *port_ = lport_lookup_by_uuid(lports, uuid);
+    struct lport *port = CONST_CAST(struct lport *, port_);
     if (port) {
-        hmap_remove(&lports->by_name, (struct hmap_node *) &port->name_node);
-        hmap_remove(&lports->by_key, (struct hmap_node *) &port->key_node);
-        hmap_remove(&lports->by_uuid, (struct hmap_node *) &port->uuid_node);
-        free((void *) port);
+        hmap_remove(&lports->by_name, &port->name_node);
+        hmap_remove(&lports->by_key, &port->key_node);
+        hmap_remove(&lports->by_uuid, &port->uuid_node);
+        free(port);
     }
 }
 
@@ -180,6 +180,8 @@ struct mcgroup {
     const struct sbrec_multicast_group *mg;
 };
 
+static bool full_mc_rebuild = false;
+
 void
 mcgroup_index_reset(void)
 {
@@ -196,13 +198,12 @@ mcgroup_index_init(struct mcgroup_index *mcgroups)
 void
 mcgroup_index_remove(struct mcgroup_index *mcgroups, const struct uuid *uuid)
 {
-    const struct mcgroup *mcgroup = mcgroup_lookup_by_uuid(mcgroups, uuid);
+    const struct mcgroup *mcgroup_ = mcgroup_lookup_by_uuid(mcgroups, uuid);
+    struct mcgroup *mcgroup = CONST_CAST(struct mcgroup *, mcgroup_);
     if (mcgroup) {
-        hmap_remove(&mcgroups->by_dp_name,
-                    (struct hmap_node *) &mcgroup->dp_name_node);
-        hmap_remove(&mcgroups->by_uuid,
-                    (struct hmap_node *) &mcgroup->uuid_node);
-        free((void *) mcgroup);
+        hmap_remove(&mcgroups->by_dp_name, &mcgroup->dp_name_node);
+        hmap_remove(&mcgroups->by_uuid, &mcgroup->uuid_node);
+        free(mcgroup);
     }
 }
 
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to