bpf: Fix various lib and testsuite build failures on 32-bit.

Cannot cast a u64 to a pointer on 32-bit without an intervening (long)
cast otherwise GCC warns.

Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
This commit is contained in:
David Miller
2018-11-28 12:56:10 -08:00
committed by Alexei Starovoitov
parent 295daee4ba
commit 1ad93ab10e
2 changed files with 6 additions and 6 deletions

View File

@@ -466,7 +466,7 @@ int btf__get_from_id(__u32 id, struct btf **btf)
goto exit_free;
}
*btf = btf__new((__u8 *)btf_info.btf, btf_info.btf_size, NULL);
*btf = btf__new((__u8 *)(long)btf_info.btf, btf_info.btf_size, NULL);
if (IS_ERR(*btf)) {
err = PTR_ERR(*btf);
*btf = NULL;