On 31 January 2017 at 16:57, Joe Stringer <[email protected]> wrote: > /* Returns true if a variable length meta-flow field 'mff' is not mapped in > * the 'vl_mff_map'. */ > bool > -mf_vl_mff_not_mapped(const struct mf_field *mff, > - const struct vl_mff_map *vl_mff_map) > +mf_vl_mff_mapped(const struct mf_field *mff, const struct vl_mff_map *map) > { > - if (mff && vl_mff_map) { > - if (mff->variable_len && !mff->mapped) { > - return true; > - } > - } > - > - return false; > + return !(map && mff && mff->variable_len && !mff->mapped); > }
Yi-Hung pointed out offline that this reversal doesn't quite sit right logically; this function is searching for a specific set of invalid conditions, where there is a vl_mff_map, and the field is variable-length, and it's not mapped. It's misleading to have all of this covered by a function named "...mapped()". I suggest we retain the original logic but rename the function to something like mf_vl_mff_invalid(). _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
