ofproto-dpif-xlate: Simplify 'sample_actions_len' calculation.
authorBen Pfaff <blp@nicira.com>
Thu, 23 Jul 2015 23:40:38 +0000 (16:40 -0700)
committerBen Pfaff <blp@nicira.com>
Fri, 31 Jul 2015 22:14:01 +0000 (15:14 -0700)
It's always the size of 'odp_actions' following adding the sample actions.

This is a stylistic change that should not change behavior.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
ofproto/ofproto-dpif-xlate.c

index 6bad7f9..e69605e 100644 (file)
@@ -4953,8 +4953,6 @@ xlate_actions(struct xlate_in *xin, struct xlate_out *xout)
     /* Do not perform special processing on recirculated packets,
      * as recirculated packets are not really received by the bridge. */
     if (xin->recirc || !process_special(&ctx, in_port)) {
-        size_t sample_actions_len;
-
         if (flow->in_port.ofp_port
             != vsp_realdev_to_vlandev(xbridge->ofproto,
                                       flow->in_port.ofp_port,
@@ -4966,10 +4964,8 @@ xlate_actions(struct xlate_in *xin, struct xlate_out *xout)
         if (!xin->recirc) {
             add_sflow_action(&ctx);
             add_ipfix_action(&ctx);
-            sample_actions_len = ctx.odp_actions->size;
-        } else {
-            sample_actions_len = 0;
         }
+        size_t sample_actions_len = ctx.odp_actions->size;
 
         if (tnl_may_send && (!in_port || may_receive(in_port, &ctx))) {
             const struct ofpact *ofpacts;