aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/prog_tests/snprintf.c
diff options
context:
space:
mode:
authorGeliang Tang <geliang.tang@suse.com>2022-04-09 07:58:17 +0800
committerDaniel Borkmann <daniel@iogearbox.net>2022-04-11 17:18:09 +0200
commitf4fd706f738338e78f413db36d0a483a11c53cd1 (patch)
treef18bbcda5345584a3b08ec6116a35a8e61d3c862 /tools/testing/selftests/bpf/prog_tests/snprintf.c
parentdd642ccb45ecce1402eb2550f5284fc6bb9ed7b8 (diff)
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.c4
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);

Privacy Policy