Better not use access to the *_collection_stub(), as it is an internal implementation detail.
Signed-off-by: Jarno Rajahalme <ja...@ovn.org> --- lib/object-collection.h | 5 ----- ofproto/ofproto.c | 10 +++++----- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/lib/object-collection.h b/lib/object-collection.h index a0ad0f2..4903451 100644 --- a/lib/object-collection.h +++ b/lib/object-collection.h @@ -78,11 +78,6 @@ static inline TYPE* NAME##_collection_##NAME##s(const struct NAME##_collection * return (TYPE*)coll->collection.objs; \ } \ \ -static inline TYPE* NAME##_collection_stub(struct NAME##_collection *coll) \ -{ \ - return (TYPE*)coll->collection.stub; \ -} \ - \ static inline size_t NAME##_collection_n(const struct NAME##_collection *coll) \ { \ return coll->collection.n; \ diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index 97ed61a..2971814 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -4692,7 +4692,7 @@ add_flow_start(struct ofproto *ofproto, struct ofproto_flow_mod *ofm) rule_collection_add(&ofm->old_rules, old_rule); } /* Take ownership of the temp_rule. */ - rule_collection_stub(&ofm->new_rules)[0] = new_rule; + rule_collection_add(&ofm->new_rules, new_rule); ofm->temp_rule = NULL; replace_rule_start(ofproto, ofm, old_rule, new_rule); @@ -4705,8 +4705,8 @@ add_flow_revert(struct ofproto *ofproto, struct ofproto_flow_mod *ofm) OVS_REQUIRES(ofproto_mutex) { struct rule *old_rule = rule_collection_n(&ofm->old_rules) - ? rule_collection_stub(&ofm->old_rules)[0] : NULL; - struct rule *new_rule = rule_collection_stub(&ofm->new_rules)[0]; + ? rule_collection_rules(&ofm->old_rules)[0] : NULL; + struct rule *new_rule = rule_collection_rules(&ofm->new_rules)[0]; replace_rule_revert(ofproto, old_rule, new_rule); } @@ -4718,8 +4718,8 @@ add_flow_finish(struct ofproto *ofproto, struct ofproto_flow_mod *ofm, OVS_REQUIRES(ofproto_mutex) { struct rule *old_rule = rule_collection_n(&ofm->old_rules) - ? rule_collection_stub(&ofm->old_rules)[0] : NULL; - struct rule *new_rule = rule_collection_stub(&ofm->new_rules)[0]; + ? rule_collection_rules(&ofm->old_rules)[0] : NULL; + struct rule *new_rule = rule_collection_rules(&ofm->new_rules)[0]; struct ovs_list dead_cookies = OVS_LIST_INITIALIZER(&dead_cookies); replace_rule_finish(ofproto, ofm, req, old_rule, new_rule, &dead_cookies); -- 2.1.4 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev