mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 14:53:58 -04:00
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
This commit is contained in:
committed by
Daniel Borkmann
parent
dd642ccb45
commit
f4fd706f73
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user