Skip to contentSkip to conversation

selftests-mm-remove-unreachable-returns-after-ksft-exit-helpers.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Oct 9

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: selftests/mm: remove unreachable returns after ksft exit helpers
has been removed from the -mm tree. Its filename was
selftests-mm-remove-unreachable-returns-after-ksft-exit-helpers.patch

This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: "Zenghui Yu (Huawei)" <[email protected]>
Subject: selftests/mm: remove unreachable returns after ksft exit helpers
Date: Thu, 3 Sep 2026 21:52:51 +0800

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
Cc Kiryl Shutsemau <[email protected]>
Cc Baolin Wang <[email protected]>
Cc Barry Song <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc Dev Jain <[email protected]>
Cc Lance Yang <[email protected]>
Cc Liam R. Howlett <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc Ryan Roberts <[email protected]>
Cc Shuah Khan <[email protected]>
Cc Suren Baghdasaryan <[email protected]>
Cc Vlastimil Babka <[email protected]>

---

 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(-)
tools/testing/selftests/mm/folio_split_race_test.c renamed from tools/testing/selftests/mm/folio_split_race_test.c~selftests-mm-remove-unreachable-returns-after-ksft-exit-helpers +0 -2
@@ -269,6 +269,4 @@ int main(void)
 				      NUM_ITERATIONS);
 
 	ksft_exit(iter == NUM_ITERATIONS);
-
-	return 0;
 }
tools/testing/selftests/mm/mlock-random-test.c renamed from tools/testing/selftests/mm/mlock-random-test.c~selftests-mm-remove-unreachable-returns-after-ksft-exit-helpers +0 -1
@@ -71,7 +71,6 @@ int get_proc_locked_vm_size(void)
 
 	fclose(f);
 	ksft_exit_fail_msg("cannot parse VmLck in /proc/self/status: %s\n", strerror(errno));
-	return -1;
 }
 
 /*
tools/testing/selftests/mm/pkey_sighandler_tests.c renamed from tools/testing/selftests/mm/pkey_sighandler_tests.c~selftests-mm-remove-unreachable-returns-after-ksft-exit-helpers +0 -1
@@ -556,5 +556,4 @@ int main(int argc, char *argv[])
 	}
 
 	ksft_finished();
-	return 0;
 }
tools/testing/selftests/mm/split_huge_page_test.c renamed from tools/testing/selftests/mm/split_huge_page_test.c~selftests-mm-remove-unreachable-returns-after-ksft-exit-helpers +0 -4
@@ -101,7 +101,6 @@ static bool is_backed_by_folio(char *vad
 	return (pfn_flags & folio_tail_flags) != folio_tail_flags;
 fail:
 	ksft_exit_fail_msg("Failed to get folio info\n");
-	return false;
 }
 
 static int check_after_split_folio_orders(char *vaddr_start, size_t len,
@@ -548,7 +547,6 @@ err_out_close:
 err_out_unlink:
 	unlink(testfile);
 	ksft_exit_fail_msg("Failed to create large pagecache folios\n");
-	return -1;
 }
 
 static void split_thp_in_pagecache_to_order_at(size_t fd_size,
@@ -711,6 +709,4 @@ int main(int argc, char **argv)
 	free(expected_orders);
 
 	ksft_finished();
-
-	return 0;
 }

_

Patches currently in -mm which might be from [email protected] are

selftests-damon-stop-kdamond-on-error-exits-of-no-op-commit-test.patch selftests-damon-ignore-test-generated-damon_dump_output.patch mm-damon-api-remove-unused-nr_damos_-enumerators.patch