[ovs-dev] [PATCH] bridge: Improve iface_set_ofport() style.
Ethan Jackson
ethan at nicira.com
Thu Dec 5 02:18:43 UTC 2013
Acked-by: Ethan Jackson <ethan at nicira.com>
On Wed, Dec 4, 2013 at 4:47 PM, Ben Pfaff <blp at nicira.com> wrote:
> This should behave the same as before but the code reads more naturally to
> me this way.
>
> Signed-off-by: Ben Pfaff <blp at nicira.com>
> ---
> vswitchd/bridge.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
> index 6ce7d2b..0f4cf2c 100644
> --- a/vswitchd/bridge.c
> +++ b/vswitchd/bridge.c
> @@ -3594,10 +3594,9 @@ iface_set_mac(struct iface *iface)
> static void
> iface_set_ofport(const struct ovsrec_interface *if_cfg, ofp_port_t ofport)
> {
> - int64_t port_;
> - port_ = (ofport == OFPP_NONE) ? -1 : ofp_to_u16(ofport);
> if (if_cfg && !ovsdb_idl_row_is_synthetic(&if_cfg->header_)) {
> - ovsrec_interface_set_ofport(if_cfg, &port_, 1);
> + int64_t port = ofport == OFPP_NONE ? -1 : ofp_to_u16(ofport);
> + ovsrec_interface_set_ofport(if_cfg, &port, 1);
> }
> }
>
> --
> 1.7.10.4
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
More information about the dev
mailing list