[PATCH 2/2] selftests/mm: guard-regions: Use SKIP() instead of ksft_exit_skip()

From: wang lian
Date: Thu Jul 17 2025 - 09:20:13 EST


To ensure only the current test is skipped on permission failure, instead
of terminating the entire test binary.

Signed-off-by: wang lian <lianux.mm@xxxxxxxxx>
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@xxxxxxxxxx>
Acked-by: David Hildenbrand <david@xxxxxxxxxx>
---
tools/testing/selftests/mm/guard-regions.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/mm/guard-regions.c b/tools/testing/selftests/mm/guard-regions.c
index 4b76e72e7053..b0d42eb04e3a 100644
--- a/tools/testing/selftests/mm/guard-regions.c
+++ b/tools/testing/selftests/mm/guard-regions.c
@@ -575,7 +575,7 @@ TEST_F(guard_regions, process_madvise)

/* OK we don't have permission to do this, skip. */
if (count == -1 && errno == EPERM)
- ksft_exit_skip("No process_madvise() permissions, try running as root.\n");
+ SKIP(return, "No process_madvise() permissions, try running as root.\n");

/* Returns the number of bytes advised. */
ASSERT_EQ(count, 6 * page_size);
--
2.43.0