[ovs-git] [openvswitch/ovs] 34533d: expr: Fix some bad naming.

GitHub noreply at github.com
Wed Feb 7 18:28:26 UTC 2018


  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: 34533d372dc1a3c9bbbcd6b8ca51c81287e996f5
      https://github.com/openvswitch/ovs/commit/34533d372dc1a3c9bbbcd6b8ca51c81287e996f5
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2018-02-07 (Wed, 07 Feb 2018)

  Changed paths:
    M ovn/lib/expr.c

  Log Message:
  -----------
  expr: Fix some bad naming.

expr_is_cmp() was badly named because it didn't just check for whether its
argument was an EXPR_T_CMP node.

struct expr_sort's 'relop' member was badly named because it wasn't a
relational operator, it was a symbol.

This commit improves both names.

Signed-off-by: Ben Pfaff <blp at ovn.org>
Acked-by: Numan Siddique <nusiddiq at redhat.com>


  Commit: 582bd869af597538d76fa08627bafa510dacf492
      https://github.com/openvswitch/ovs/commit/582bd869af597538d76fa08627bafa510dacf492
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2018-02-07 (Wed, 07 Feb 2018)

  Changed paths:
    M ovn/lib/expr.c

  Log Message:
  -----------
  expr: Make expr_sort() always yield an expr that satisfies invariants.

Expressions of type EXPR_T_AND are supposed to follow an invariant that
they have at least 2 clauses, but expr_sort() did not always follow that;
for example, applying it to (x[0] == 1 && x[1] == 1) yielded the 1-child
EXPR_T_AND expression x[0..1] == 3.  This commit fixes the problem.

I don't know of any externally visible negative consequences for this
problem, but it made the code harder to reason about.

Signed-off-by: Ben Pfaff <blp at ovn.org>
Acked-by: Numan Siddique <nusiddiq at redhat.com>


  Commit: eb202465d278ef8c0a277ebfeae5dd04f8c48242
      https://github.com/openvswitch/ovs/commit/eb202465d278ef8c0a277ebfeae5dd04f8c48242
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2018-02-07 (Wed, 07 Feb 2018)

  Changed paths:
    M tests/test-ovn.c

  Log Message:
  -----------
  expr: Add additional invariant check in test.

Signed-off-by: Ben Pfaff <blp at ovn.org>
Acked-by: Numan Siddique <nusiddiq at redhat.com>


Compare: https://github.com/openvswitch/ovs/compare/ec5ef1cf5525...eb202465d278


More information about the git mailing list