Skip to contentSkip to conversation

kselftest/pidfd: Make all test functions return int

PATCH New Ivan Pravdin 1 participant 1 message May 21, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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")
---
 tools/testing/selftests/pidfd/pidfd_test.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
tools/testing/selftests/pidfd/pidfd_test.c +4 -2
index fcd85cad9f18..645ac8e35033 100644
@@ -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)
Signature · 1 line
2.45.2