Acked-by: Chengwen Feng <[email protected]>

On 2024/11/22 2:23, Stephen Hemminger wrote:
> The loop over policy actions will always exit when it sees
> the flow end action, so the next check is redundant.
> 
> Link: https://pvs-studio.com/en/blog/posts/cpp/1179/
> 
> Fixes: f29fa2c59b85 ("app/testpmd: support policy actions per color")
> Cc: [email protected]
> Signed-off-by: Stephen Hemminger <[email protected]>
> Acked-by: Bruce Richardson <[email protected]>
> Acked-by: Ajit Khaparde <[email protected]>
> ---
>  app/test-pmd/config.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
> index 28d45568ac..4e7fb69183 100644
> --- a/app/test-pmd/config.c
> +++ b/app/test-pmd/config.c
> @@ -2288,7 +2288,7 @@ port_meter_policy_add(portid_t port_id, uint32_t 
> policy_id,
>               for (act_n = 0, start = act;
>                       act->type != RTE_FLOW_ACTION_TYPE_END; act++)
>                       act_n++;
> -             if (act_n && act->type == RTE_FLOW_ACTION_TYPE_END)
> +             if (act_n > 0)
>                       policy.actions[i] = start;
>               else
>                       policy.actions[i] = NULL;
> @@ -7338,4 +7338,3 @@ show_mcast_macs(portid_t port_id)
>               printf("  %s\n", buf);
>       }
>  }
> -

Reply via email to