Re: [PATCH] selftests/mm: remove unreachable returns after ksft exit helpers

From: Zi Yan

Date: Thu Sep 03 2026 - 21:34:14 EST


On Thu Sep 3, 2026 at 9:52 AM EDT, Zenghui Yu wrote:
> From: "Zenghui Yu (Huawei)" <zenghui.yu@xxxxxxxxx>
>
> The ksft_exit*() helpers such as ksft_exit_fail_msg() are declared
> __noreturn, and the ksft_exit() and ksft_finished() macros expand to calls
> of them, always terminating the process via exit(). Any return statements
> following such calls are unreachable, both at the end of main() and on
> error paths of helper functions.
>
> Remove all of them. No functional change.
>
> Assisted-by: GLM-5.3 OpenCode
> Signed-off-by: Zenghui Yu (Huawei) <zenghui.yu@xxxxxxxxx>
> ---
> tools/testing/selftests/mm/folio_split_race_test.c | 2 --
> tools/testing/selftests/mm/mlock-random-test.c | 1 -
> tools/testing/selftests/mm/pkey_sighandler_tests.c | 1 -
> tools/testing/selftests/mm/split_huge_page_test.c | 4 ----
> 4 files changed, 8 deletions(-)
>
Reviewed-by: Zi Yan <ziy@xxxxxxxxxx>

--
Best Regards,
Yan, Zi