]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf: Fix casting error when cross-compiling test_verifier for 32-bit platforms
authorPu Lehui <pulehui@huawei.com>
Tue, 8 Nov 2022 12:19:45 +0000 (20:19 +0800)
committerMartin KaFai Lau <martin.lau@kernel.org>
Wed, 9 Nov 2022 20:23:25 +0000 (12:23 -0800)
commit3196049c1180b68af6ad3b0c933adfce858a160a
tree4bf77529e25174d766661b6a90366a18ed1e32ce
parent5b1fe02df0a28c83fe7697302c59fcfeaef55242
selftests/bpf: Fix casting error when cross-compiling test_verifier for 32-bit platforms

When cross-compiling test_verifier for 32-bit platforms, the casting error is shown below:

test_verifier.c:1263:27: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
 1263 |  info.xlated_prog_insns = (__u64)*buf;
      |                           ^
cc1: all warnings being treated as errors

Fix it by adding zero-extension for it.

Fixes: 8b59aae8407c ("selftests/bpf: specify expected instructions in test_verifier tests")
Signed-off-by: Pu Lehui <pulehui@huawei.com>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/r/20221108121945.4104644-1-pulehui@huaweicloud.com
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
tools/testing/selftests/bpf/test_verifier.c