Re: [PATCH] bpf: remove trunctaiton warning in BPF_LD_IMM64_RAW

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

 



On 03/14, Ben Dooks wrote:
> When building W=1, the following warningds get generated by lib/test_bpf.c
> due to the BPF_LD_IMM64_RAW() truncating a 64bit to 32bit value without
> a specific mask to do so.
> 
> lib/test_bpf.c:6441:25: warning: cast truncates bits from constant value (ffffffff0000 becomes ffff0000)
> lib/test_bpf.c:6442:25: warning: cast truncates bits from constant value (ffffffff0000 becomes ffff0000)
> lib/test_bpf.c:6473:25: warning: cast truncates bits from constant value (123456789abcdef becomes 89abcdef)
> lib/test_bpf.c:6489:25: warning: cast truncates bits from constant value (123456789abcdef becomes 89abcdef)
> lib/test_bpf.c:6490:25: warning: cast truncates bits from constant value (123456780a0c0e0 becomes 80a0c0e0)
> lib/test_bpf.c:6599:25: warning: cast truncates bits from constant value (123456789abcdef becomes 89abcdef)
> lib/test_bpf.c:6637:25: warning: cast truncates bits from constant value (ffffffff0000 becomes ffff0000)
> 
> (more warnings truncated)
> 
> Signed-off-by: Ben Dooks <ben.dooks@xxxxxxxxxxxxxxx>

I wonder how many other places (in the kernel) we have where we silently
cast u64 to u32.. Surprised that's the only warning you get :-)

Acked-by: Stanislav Fomichev <sdf@xxxxxxxxxx>




[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