On Fri, Nov 15, 2024 at 12:08 PM 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: haifeil@nvidia.com > Signed-off-by: Stephen Hemminger > Acked-by: Bruce Richardson Acked-by: Ajit Khaparde > --- > 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 >