mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] kselftest/pidfd: Make all test functions return int
@ 2025-05-21  5:09 Ivan Pravdin
  0 siblings, 0 replies; only message in thread
From: Ivan Pravdin @ 2025-05-21  5:09 UTC (permalink / raw)
  To: brauner, shuah; +Cc: linux-kernel, linux-kselftest, Ivan Pravdin

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@gmail.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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-05-21  5:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-05-21  5:09 [PATCH] kselftest/pidfd: Make all test functions return int Ivan Pravdin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®