summaryrefslogtreecommitdiff
path: root/tools/testing
diff options
context:
space:
mode:
authorTony Ambardar <tony.ambardar@gmail.com>2024-07-23 08:54:35 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-10-04 17:29:16 +0300
commit4bff8cc537ce4f37b3ec47de7db9523b6c95c11e (patch)
tree40d0223bf67492c49e48122e453c470731cb338c /tools/testing
parent2388d181667a728f1b91e17d4e9897ba739dcc43 (diff)
downloadlinux-4bff8cc537ce4f37b3ec47de7db9523b6c95c11e.tar.xz
selftests/bpf: Fix missing UINT_MAX definitions in benchmarks
[ Upstream commit a2c155131b710959beb508ca6a54769b6b1bd488 ] Include <limits.h> in 'bench.h' to provide a UINT_MAX definition and avoid multiple compile errors against mips64el/musl-libc like: benchs/bench_local_storage.c: In function 'parse_arg': benchs/bench_local_storage.c:40:38: error: 'UINT_MAX' undeclared (first use in this function) 40 | if (ret < 1 || ret > UINT_MAX) { | ^~~~~~~~ benchs/bench_local_storage.c:11:1: note: 'UINT_MAX' is defined in header '<limits.h>'; did you forget to '#include <limits.h>'? 10 | #include <test_btf.h> +++ |+#include <limits.h> 11 | seen with bench_local_storage.c, bench_local_storage_rcu_tasks_trace.c, and bench_bpf_hashmap_lookup.c. Fixes: 73087489250d ("selftests/bpf: Add benchmark for local_storage get") Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/8f64a9d9fcff40a7fca090a65a68a9b62a468e16.1721713597.git.tony.ambardar@gmail.com Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools/testing')
-rw-r--r--tools/testing/selftests/bpf/bench.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/bench.h b/tools/testing/selftests/bpf/bench.h
index 68180d8f8558..005c401b3e22 100644
--- a/tools/testing/selftests/bpf/bench.h
+++ b/tools/testing/selftests/bpf/bench.h
@@ -10,6 +10,7 @@
#include <math.h>
#include <time.h>
#include <sys/syscall.h>
+#include <limits.h>
struct cpu_set {
bool *cpus;