On Fri, Nov 15, 2024 at 12:08 PM Stephen Hemminger <[email protected]> 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 88770b4dfc..32c4e86c84 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;
> @@ -7316,4 +7316,3 @@ show_mcast_macs(portid_t port_id)
> printf(" %s\n", buf);
> }
> }
> -
> --
> 2.45.2
>
smime.p7s
Description: S/MIME Cryptographic Signature

