[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20250521050906.629641-1-ipravdin.official@gmail.com>
Date: Wed, 21 May 2025 01:09:06 -0400
From: Ivan Pravdin <ipravdin.official@...il.com>
To: brauner@...nel.org,
shuah@...nel.org
Cc: linux-kernel@...r.kernel.org,
linux-kselftest@...r.kernel.org,
Ivan Pravdin <ipravdin.official@...il.com>
Subject: [PATCH] kselftest/pidfd: Make all test functions return int
The pidfd_test suite currently defines six test functions,
four of which return an int, while the remaining
two return void. This is inconsistent.
To address this, convert the two void-returning test
functions to return int, bringing them in line with
the rest. For now, the functions always return 0.
Fixes: 740378dc7834b ("pidfd: add polling selftests")
Signed-off-by: Ivan Pravdin <ipravdin.official@...il.com>
---
tools/testing/selftests/pidfd/pidfd_test.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/pidfd/pidfd_test.c b/tools/testing/selftests/pidfd/pidfd_test.c
index fcd85cad9f18..645ac8e35033 100644
--- a/tools/testing/selftests/pidfd/pidfd_test.c
+++ b/tools/testing/selftests/pidfd/pidfd_test.c
@@ -492,7 +492,7 @@ static int child_poll_exec_test(void *args)
return 0;
}
-static void test_pidfd_poll_exec(int use_waitpid)
+static int test_pidfd_poll_exec(int use_waitpid)
{
int pid, pidfd = 0;
int status, ret;
@@ -528,6 +528,7 @@ static void test_pidfd_poll_exec(int use_waitpid)
ksft_exit_fail_msg("%s test: Failed\n", test_name);
else
ksft_test_result_pass("%s test: Passed\n", test_name);
+ return 0;
}
static void *test_pidfd_poll_leader_exit_thread(void *priv)
@@ -558,7 +559,7 @@ static int child_poll_leader_exit_test(void *args)
exit(0);
}
-static void test_pidfd_poll_leader_exit(int use_waitpid)
+static int test_pidfd_poll_leader_exit(int use_waitpid)
{
int pid, pidfd = 0;
int status, ret = 0;
@@ -608,6 +609,7 @@ static void test_pidfd_poll_leader_exit(int use_waitpid)
ksft_exit_fail_msg("%s test: Failed\n", test_name);
else
ksft_test_result_pass("%s test: Passed\n", test_name);
+ return 0;
}
int main(int argc, char **argv)
--
2.45.2
Powered by blists - more mailing lists