Re: [PATCH bpf-next v2 1/2] bpf: Get better reg range with ldsx and 32bit compare

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jul 12, 2024 at 1:28 PM Yonghong Song <yonghong.song@xxxxxxxxx> wrote:
> +       if (reg->s32_min_value >= 0) {
> +               if ((reg->smin_value >= S32_MIN && reg->smax_value <= S32_MAX) ||
> +                   (reg->smin_value >= S16_MIN && reg->smax_value <= S16_MAX) ||
> +                   (reg->smin_value >= S8_MIN && reg->smax_value <= S8_MAX)) {

Could you do:
if (reg->s32_min_value >= 0 &&
    (reg->smin_value >= S32_MIN ...

to remove one indent below.

> +                       reg->smin_value = reg->umin_value = reg->s32_min_value;
> +                       reg->smax_value = reg->umax_value = reg->s32_max_value;
> +                       reg->var_off = tnum_intersect(reg->var_off,
> +                                                     tnum_range(reg->smin_value,
> +                                                                reg->smax_value));





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux