diff --git a/tools/testing/selftests/bpf/multi_check.h b/tools/testing/selftests/bpf/multi_check.h
index 36c2a93f9be3..f720a6f9c6e4 100644
--- a/tools/testing/selftests/bpf/multi_check.h
+++ b/tools/testing/selftests/bpf/multi_check.h
@@ -5,26 +5,27 @@
 
 extern unsigned long long bpf_fentry_test[8];
 
-static __attribute__((unused)) inline
-void multi_arg_check(unsigned long ip, __u64 a, __u64 b, __u64 c, __u64 d, __u64 e, __u64 f, __u64 *test_result)
-{
-	if (ip == bpf_fentry_test[0]) {
-		*test_result += (int) a == 1;
-	} else if (ip == bpf_fentry_test[1]) {
-		*test_result += (int) a == 2 && (__u64) b == 3;
-	} else if (ip == bpf_fentry_test[2]) {
-		*test_result += (char) a == 4 && (int) b == 5 && (__u64) c == 6;
-	} else if (ip == bpf_fentry_test[3]) {
-		*test_result += (void *) a == (void *) 7 && (char) b == 8 && (int) c == 9 && (__u64) d == 10;
-	} else if (ip == bpf_fentry_test[4]) {
-		*test_result += (__u64) a == 11 && (void *) b == (void *) 12 && (short) c == 13 && (int) d == 14 && (__u64) e == 15;
-	} else if (ip == bpf_fentry_test[5]) {
-		*test_result += (__u64) a == 16 && (void *) b == (void *) 17 && (short) c == 18 && (int) d == 19 && (void *) e == (void *) 20 && (__u64) f == 21;
-	} else if (ip == bpf_fentry_test[6]) {
-		*test_result += 1;
-	} else if (ip == bpf_fentry_test[7]) {
-		*test_result += 1;
-	}
+#define MULTI_ARG_CHECK(_name) \
+static __attribute__((unused)) inline \
+void _name ## _multi_arg_check(unsigned long ip, __u64 a, __u64 b, __u64 c, __u64 d, __u64 e, __u64 f, __u64 *test_result)						\
+{																					\
+	if (ip == bpf_fentry_test[0]) {																	\
+		*test_result +=	(int) a == 1;																\
+	} else if (ip == bpf_fentry_test[1]) {																\
+		*test_result +=	(int) a == 2 && (__u64) b == 3;														\
+	} else if (ip == bpf_fentry_test[2]) {																\
+		*test_result +=	(char) a == 4 && (int) b == 5 && (__u64) c == 6;											\
+	} else if (ip == bpf_fentry_test[3]) {																\
+		*test_result +=	(void *) a == (void *) 7 && (char) b == 8 && (int) c == 9 && (__u64) d == 10;								\
+	} else if (ip == bpf_fentry_test[4]) {																\
+		*test_result +=	(__u64) a == 11 && (void *) b == (void *) 12 && (short) c == 13 && (int) d == 14 && (__u64) e == 15;					\
+	} else if (ip == bpf_fentry_test[5]) {																\
+		*test_result +=	(__u64) a == 16 && (void *) b == (void *) 17 && (short) c == 18 && (int) d == 19 && (void *) e == (void *) 20 && (__u64) f == 21;	\
+	} else if (ip == bpf_fentry_test[6]) {																\
+		*test_result += 1;																	\
+	} else if (ip == bpf_fentry_test[7]) {																\
+		*test_result += 1;																	\
+	}																				\
 }
 
 static __attribute__((unused)) inline
diff --git a/tools/testing/selftests/bpf/progs/fentry_fexit_multi_test.c b/tools/testing/selftests/bpf/progs/fentry_fexit_multi_test.c
index e25ab0085399..dc5b51f20b84 100644
--- a/tools/testing/selftests/bpf/progs/fentry_fexit_multi_test.c
+++ b/tools/testing/selftests/bpf/progs/fentry_fexit_multi_test.c
@@ -6,6 +6,9 @@
 
 char _license[] SEC("license") = "GPL";
 
+MULTI_ARG_CHECK(fentry)
+MULTI_ARG_CHECK(fexit)
+
 unsigned long long bpf_fentry_test[8];
 
 __u64 test1_arg_result = 0;
@@ -15,14 +18,14 @@ __u64 test2_ret_result = 0;
 SEC("fentry.multi/bpf_fentry_test*")
 int BPF_PROG(test1, unsigned long ip, __u64 a, __u64 b, __u64 c, __u64 d, __u64 e, __u64 f)
 {
-	multi_arg_check(ip, a, b, c, d, e, f, &test1_arg_result);
+	fentry_multi_arg_check(ip, a, b, c, d, e, f, &test1_arg_result);
 	return 0;
 }
 
 SEC("fexit.multi/")
 int BPF_PROG(test2, unsigned long ip, __u64 a, __u64 b, __u64 c, __u64 d, __u64 e, __u64 f, int ret)
 {
-	multi_arg_check(ip, a, b, c, d, e, f, &test2_arg_result);
+	fexit_multi_arg_check(ip, a, b, c, d, e, f, &test2_arg_result);
 	multi_ret_check(ip, ret, &test2_ret_result);
 	return 0;
 }
diff --git a/tools/testing/selftests/bpf/progs/fentry_multi_test.c b/tools/testing/selftests/bpf/progs/fentry_multi_test.c
index a443fc958e5a..b3a025632e77 100644
--- a/tools/testing/selftests/bpf/progs/fentry_multi_test.c
+++ b/tools/testing/selftests/bpf/progs/fentry_multi_test.c
@@ -6,6 +6,8 @@
 
 char _license[] SEC("license") = "GPL";
 
+MULTI_ARG_CHECK(fentry)
+
 unsigned long long bpf_fentry_test[8];
 
 __u64 test_result = 0;
@@ -13,6 +15,6 @@ __u64 test_result = 0;
 SEC("fentry.multi/bpf_fentry_test*")
 int BPF_PROG(test, unsigned long ip, __u64 a, __u64 b, __u64 c, __u64 d, __u64 e, __u64 f)
 {
-	multi_arg_check(ip, a, b, c, d, e, f, &test_result);
+	fentry_multi_arg_check(ip, a, b, c, d, e, f, &test_result);
 	return 0;
 }
diff --git a/tools/testing/selftests/bpf/progs/fexit_multi_test.c b/tools/testing/selftests/bpf/progs/fexit_multi_test.c
index 365575cf05a0..8af0d65128d6 100644
--- a/tools/testing/selftests/bpf/progs/fexit_multi_test.c
+++ b/tools/testing/selftests/bpf/progs/fexit_multi_test.c
@@ -6,6 +6,8 @@
 
 char _license[] SEC("license") = "GPL";
 
+MULTI_ARG_CHECK(fexit)
+
 unsigned long long bpf_fentry_test[8];
 
 __u64 test_arg_result = 0;
@@ -14,7 +16,7 @@ __u64 test_ret_result = 0;
 SEC("fexit.multi/bpf_fentry_test*")
 int BPF_PROG(test, unsigned long ip, __u64 a, __u64 b, __u64 c, __u64 d, __u64 e, __u64 f, int ret)
 {
-	multi_arg_check(ip, a, b, c, d, e, f, &test_arg_result);
+	fexit_multi_arg_check(ip, a, b, c, d, e, f, &test_arg_result);
 	multi_ret_check(ip, ret, &test_ret_result);
 	return 0;
 }
