Skip to content

Commit a2c1551

Browse files
guidosarduccianakryiko
authored andcommitted
selftests/bpf: Fix missing UINT_MAX definitions in benchmarks
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: 7308748 ("selftests/bpf: Add benchmark for local_storage get") Signed-off-by: Tony Ambardar <[email protected]> Signed-off-by: Andrii Nakryiko <[email protected]> Link: https://lore.kernel.org/bpf/8f64a9d9fcff40a7fca090a65a68a9b62a468e16.1721713597.git.tony.ambardar@gmail.com
1 parent d44c93f commit a2c1551

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tools/testing/selftests/bpf/bench.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <math.h>
1111
#include <time.h>
1212
#include <sys/syscall.h>
13+
#include <limits.h>
1314

1415
struct cpu_set {
1516
bool *cpus;

0 commit comments

Comments
 (0)