]> git.baikalelectronics.ru Git - kernel.git/commit
tools/lib/libbpf.c: fix string format to allow build on arm32
authorSirio Balmelli <sirio@b-ad.ch>
Wed, 23 May 2018 16:17:07 +0000 (18:17 +0200)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 23 May 2018 18:18:00 +0000 (20:18 +0200)
commitf24835d26924fa6a1e55caeb98b9a431120beee6
treefb23fd6e09e0724a7ee725ec63f765c26746668b
parent1e32a4d8c1754098573f59d71a230644e47a6dda
tools/lib/libbpf.c: fix string format to allow build on arm32

On arm32, 'cd tools/testing/selftests/bpf && make' fails with:

libbpf.c:80:10: error: format ‘%ld’ expects argument of type ‘long int’, but argument 4 has type ‘int64_t {aka long long int}’ [-Werror=format=]
   (func)("libbpf: " fmt, ##__VA_ARGS__); \
          ^
libbpf.c:83:30: note: in expansion of macro ‘__pr’
 #define pr_warning(fmt, ...) __pr(__pr_warning, fmt, ##__VA_ARGS__)
                              ^~~~
libbpf.c:1072:3: note: in expansion of macro ‘pr_warning’
   pr_warning("map:%s value_type:%s has BTF type_size:%ld != value_size:%u\n",

To fix, typecast 'key_size' and amend format string.

Signed-off-by: Sirio Balmelli <sirio@b-ad.ch>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
tools/lib/bpf/libbpf.c