[ovs-dev,13/13] ofproto-dpif-xlate: Fix dead assignment reported by clang.

Message ID 1504893565-110166-14-git-send-email-bhanuprakash.bodireddy@intel.com
State New
Headers show
Series
  • Rearrange structure members for memory efficiency.
Related show

Commit Message

Bodireddy, Bhanuprakash Sept. 8, 2017, 5:59 p.m.
Clang reports that value stored in to ac_offset is never read in the
function.

Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com>
---
 ofproto/ofproto-dpif-xlate.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Greg Rose Sept. 15, 2017, 5:42 p.m. | #1
On 09/08/2017 10:59 AM, Bhanuprakash Bodireddy wrote:
> Clang reports that value stored in to ac_offset is never read in the
> function.
> 
> Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com>
> ---
>   ofproto/ofproto-dpif-xlate.c | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c
> index 9e1f837..5d83666 100644
> --- a/ofproto/ofproto-dpif-xlate.c
> +++ b/ofproto/ofproto-dpif-xlate.c
> @@ -5370,7 +5370,6 @@ compose_clone(struct xlate_ctx *ctx, const struct ofpact_nest *oc)
>       if (ctx->xbridge->support.clone) { /* Use clone action */
>           /* Use clone action as datapath clone. */
>           offset = nl_msg_start_nested(ctx->odp_actions, OVS_ACTION_ATTR_CLONE);
> -        ac_offset = ctx->odp_actions->size;
>           do_xlate_actions(oc->actions, oc_actions_len, ctx);
>           nl_msg_end_non_empty_nested(ctx->odp_actions, offset);
>           goto dp_clone_done;
> 

Not in this section of code anyway.

Looks good.

Reviewed-by: Greg Rose <gvrose8192@gmail.com>

Patch

diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c
index 9e1f837..5d83666 100644
--- a/ofproto/ofproto-dpif-xlate.c
+++ b/ofproto/ofproto-dpif-xlate.c
@@ -5370,7 +5370,6 @@  compose_clone(struct xlate_ctx *ctx, const struct ofpact_nest *oc)
     if (ctx->xbridge->support.clone) { /* Use clone action */
         /* Use clone action as datapath clone. */
         offset = nl_msg_start_nested(ctx->odp_actions, OVS_ACTION_ATTR_CLONE);
-        ac_offset = ctx->odp_actions->size;
         do_xlate_actions(oc->actions, oc_actions_len, ctx);
         nl_msg_end_non_empty_nested(ctx->odp_actions, offset);
         goto dp_clone_done;