diff options
author | 2022-04-09 07:58:17 +0800 | |
---|---|---|
committer | 2022-04-11 17:18:09 +0200 | |
commit | f4fd706f738338e78f413db36d0a483a11c53cd1 (patch) | |
tree | f18bbcda5345584a3b08ec6116a35a8e61d3c862 /tools/testing/selftests/bpf/prog_tests/snprintf.c | |
parent | riscv, bpf: Implement more atomic operations for RV64 (diff) | |
download | linux-f4fd706f738338e78f413db36d0a483a11c53cd1.tar.gz linux-f4fd706f738338e78f413db36d0a483a11c53cd1.tar.bz2 linux-f4fd706f738338e78f413db36d0a483a11c53cd1.zip |
selftests/bpf: Drop duplicate max/min definitions
Drop duplicate macros min() and MAX() definitions in prog_tests and use
MIN() or MAX() in sys/param.h instead.
Signed-off-by: Geliang Tang <geliang.tang@suse.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Song Liu <songliubraving@fb.com>
Link: https://lore.kernel.org/bpf/1ae276da9925c2de59b5bdc93b693b4c243e692e.1649462033.git.geliang.tang@suse.com
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/snprintf.c')
-rw-r--r-- | tools/testing/selftests/bpf/prog_tests/snprintf.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/snprintf.c b/tools/testing/selftests/bpf/prog_tests/snprintf.c index 394ebfc3bbf3..4be6fdb78c6a 100644 --- a/tools/testing/selftests/bpf/prog_tests/snprintf.c +++ b/tools/testing/selftests/bpf/prog_tests/snprintf.c @@ -83,8 +83,6 @@ cleanup: test_snprintf__destroy(skel); } -#define min(a, b) ((a) < (b) ? (a) : (b)) - /* Loads an eBPF object calling bpf_snprintf with up to 10 characters of fmt */ static int load_single_snprintf(char *fmt) { @@ -95,7 +93,7 @@ static int load_single_snprintf(char *fmt) if (!skel) return -EINVAL; - memcpy(skel->rodata->fmt, fmt, min(strlen(fmt) + 1, 10)); + memcpy(skel->rodata->fmt, fmt, MIN(strlen(fmt) + 1, 10)); ret = test_snprintf_single__load(skel); test_snprintf_single__destroy(skel); |