[dpdk-dev] [PATCH] bpf: delete meaningless code
Ananyev, Konstantin
konstantin.ananyev at intel.com
Wed Apr 21 13:43:15 CEST 2021
>
> 'rd->u.max = rd->u.max' is meaningless which should be deleted.
>
> This patch fixed it.
>
> Fixes: 8021917293d0 ("bpf: add extra validation for input BPF program")
> Cc: stable at dpdk.org
As I remember, I did it on purpose.
Some old (but still supported) version of clang complained
about unitialized variable.
> Signed-off-by: Min Hu (Connor) <humin29 at huawei.com>
> ---
> lib/librte_bpf/bpf_validate.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/lib/librte_bpf/bpf_validate.c b/lib/librte_bpf/bpf_validate.c
> index 9214f15..c5ad951 100644
> --- a/lib/librte_bpf/bpf_validate.c
> +++ b/lib/librte_bpf/bpf_validate.c
> @@ -517,8 +517,6 @@ eval_divmod(uint32_t op, struct bpf_reg_val *rd, struct bpf_reg_val *rs,
> } else {
> if (op == BPF_MOD)
> rd->u.max = RTE_MIN(rd->u.max, rs->u.max - 1);
> - else
> - rd->u.max = rd->u.max;
> rd->u.min = 0;
> }
>
> --
> 2.7.4
More information about the dev
mailing list