From b2e89cc94efa3232a897c1eb17f5d67dae9baf7e Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Thu, 23 Jul 2015 13:31:04 -0700 Subject: [PATCH] ofproto-dpif-xlate: Eliminate 'rule' local variable. This variable was only used as a temporary within a small scope, so it worked just as well to just use ctx.rule there instead. Signed-off-by: Ben Pfaff Acked-by: Jarno Rajahalme --- ofproto/ofproto-dpif-xlate.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c index e39e46f6e..1ecc1e83e 100644 --- a/ofproto/ofproto-dpif-xlate.c +++ b/ofproto/ofproto-dpif-xlate.c @@ -4738,7 +4738,6 @@ xlate_actions(struct xlate_in *xin, struct xlate_out *xout) } struct flow *flow = &xin->flow; - struct rule_dpif *rule = NULL; union mf_subvalue stack_stub[1024 / sizeof(union mf_subvalue)]; uint64_t action_set_stub[1024 / 8]; @@ -4907,25 +4906,22 @@ xlate_actions(struct xlate_in *xin, struct xlate_out *xout) ctx.tables_version = ofproto_dpif_get_tables_version(ctx.xbridge->ofproto); if (!xin->ofpacts && !ctx.rule) { - rule = rule_dpif_lookup_from_table(ctx.xbridge->ofproto, - ctx.tables_version, flow, xin->wc, - ctx.xin->xcache != NULL, - ctx.xin->resubmit_stats, - &ctx.table_id, - flow->in_port.ofp_port, true, true); + ctx.rule = rule_dpif_lookup_from_table( + ctx.xbridge->ofproto, ctx.tables_version, flow, xin->wc, + ctx.xin->xcache != NULL, ctx.xin->resubmit_stats, &ctx.table_id, + flow->in_port.ofp_port, true, true); if (ctx.xin->resubmit_stats) { - rule_dpif_credit_stats(rule, ctx.xin->resubmit_stats); + rule_dpif_credit_stats(ctx.rule, ctx.xin->resubmit_stats); } if (ctx.xin->xcache) { struct xc_entry *entry; entry = xlate_cache_add_entry(ctx.xin->xcache, XC_RULE); - entry->u.rule = rule; + entry->u.rule = ctx.rule; } - ctx.rule = rule; if (OVS_UNLIKELY(ctx.xin->resubmit_hook)) { - ctx.xin->resubmit_hook(ctx.xin, rule, 0); + ctx.xin->resubmit_hook(ctx.xin, ctx.rule, 0); } } xout->fail_open = ctx.rule && rule_dpif_is_fail_open(ctx.rule);