selftests: fixup build warnings in pidfd / clone3 tests
authorAxel Rasmussen <axelrasmussen@google.com>
Thu, 27 Jan 2022 22:11:15 +0000 (14:11 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 23 Feb 2022 11:03:18 +0000 (12:03 +0100)
commit54d69f072d5e2a5fa165c838cfabf744a8c353d5
tree2416e011df8964b34fa068c37a6cd3a9a2b89721
parentfc6d187f2986b20de112e9d442c4d0962860f1e6
selftests: fixup build warnings in pidfd / clone3 tests

[ Upstream commit e2aa5e650b07693477dff554053605976789fd68 ]

These are some trivial fixups, which were needed to build the tests with
clang and -Werror. The following issues are fixed:

- Remove various unused variables.
- In child_poll_leader_exit_test, clang isn't smart enough to realize
  syscall(SYS_exit, 0) won't return, so it complains we never return
  from a non-void function. Add an extra exit(0) to appease it.
- In test_pidfd_poll_leader_exit, ret may be branched on despite being
  uninitialized, if we have !use_waitpid. Initialize it to zero to get
  the right behavior in that case.

Signed-off-by: Axel Rasmussen <axelrasmussen@google.com>
Acked-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/selftests/clone3/clone3.c
tools/testing/selftests/pidfd/pidfd_test.c
tools/testing/selftests/pidfd/pidfd_wait.c