[ovs-git] [openvswitch/ovs] a9360f: physical: Add local vars to make physical_run() ea...

GitHub noreply at github.com
Tue Apr 12 17:33:46 UTC 2016


  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: a9360f2ab9d41ba2e4202e0bdc4d0a2754a3244d
      https://github.com/openvswitch/ovs/commit/a9360f2ab9d41ba2e4202e0bdc4d0a2754a3244d
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2016-04-12 (Tue, 12 Apr 2016)

  Changed paths:
    M ovn/controller/physical.c

  Log Message:
  -----------
  physical: Add local vars to make physical_run() easier to understand.

'binding->datapath->tunnel_key' and 'binding->tunnel_key' were used
repeatedly and in my opinion having local variables for each of these
makes the code a little easier to understand.

Signed-off-by: Ben Pfaff <blp at ovn.org>
Acked-by: Russell Bryant <russell at ovn.org>


  Commit: e4426e3457bb23efb1421a6e033f5ef605de19cd
      https://github.com/openvswitch/ovs/commit/e4426e3457bb23efb1421a6e033f5ef605de19cd
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2016-04-12 (Tue, 12 Apr 2016)

  Changed paths:
    M ovn/controller/binding.c
    M ovn/controller/lflow.c
    M ovn/controller/ovn-controller.c
    M ovn/controller/ovn-controller.h
    M ovn/controller/patch.c
    M ovn/controller/physical.c

  Log Message:
  -----------
  ovn-controller: Introduce helpers for looking up datapaths.

The new helpers get_local_datapath() and get_patched_datapath() make code
a little shorter and easier to read.  They also avoid a pitfall that was
present in at least a few of the instances: CONTAINER_OF is not safe on a
null pointer, because it does a raw pointer subtraction and will change
NULL to something else.  This wasn't actually a problem in these particular
cases because the value it was subtracting was zero (although arguably it
is still undefined behavior because the compiler is allowed to assume that
a pointer on which arithmetic is performed is nonnull).

Signed-off-by: Ben Pfaff <blp at ovn.org>
Acked-by: Russell Bryant <russell at ovn.org>


Compare: https://github.com/openvswitch/ovs/compare/3df358425632...e4426e3457bb


More information about the git mailing list