Re: [PATCH bpf-next 1/2] libbpf: implement bpf_usdt_arg_size BPF function

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

 



On 2/24/25 2:05 PM, Andrii Nakryiko wrote:

> [...]
>
> arg_bitshift is stored as char (which could be signed), so that's why
> you were getting signed division, just cast to unsigned and keep
> division:
>
> return (64 - (unsigned)arg_spec->arg_bitshift) / 8;

As it turns out, this doesn't work either. Presumably because
(64 - (u8)x) is still a signed int.

This works, however:

    return (unsigned char)(64 - arg_spec->arg_bitshift) / 8;

>
>> [...]





[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