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

wang lian posted 2 patches 2 months, 3 weeks ago
[PATCH 2/2] selftests/mm: guard-regions: Use SKIP() instead of ksft_exit_skip()
Posted by wang lian 2 months, 3 weeks ago
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@gmail.com>
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Acked-by: David Hildenbrand <david@redhat.com>
---
 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
Re: [PATCH 2/2] selftests/mm: guard-regions: Use SKIP() instead of ksft_exit_skip()
Posted by Zi Yan 2 months, 2 weeks ago
On 17 Jul 2025, at 9:18, wang lian wrote:

> 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@gmail.com>
> Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
> Acked-by: David Hildenbrand <david@redhat.com>
> ---
>  tools/testing/selftests/mm/guard-regions.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>

Reviewed-by: Zi Yan <ziy@nvidia.com>

Best Regards,
Yan, Zi
Re: [PATCH 2/2] selftests/mm: guard-regions: Use SKIP() instead of ksft_exit_skip()
Posted by Wei Yang 2 months, 2 weeks ago
On Thu, Jul 17, 2025 at 09:18:57PM +0800, wang lian wrote:
>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@gmail.com>
>Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
>Acked-by: David Hildenbrand <david@redhat.com>

Reviewed-by: Wei Yang <richard.weiyang@gmail.com>

-- 
Wei Yang
Help you, Help me
Re: [PATCH 2/2] selftests/mm: guard-regions: Use SKIP() instead of ksft_exit_skip()
Posted by Mark Brown 2 months, 3 weeks ago
On Thu, Jul 17, 2025 at 09:18:57PM +0800, wang lian wrote:
> To ensure only the current test is skipped on permission failure, instead
> of terminating the entire test binary.

Reviewed-by: Mark Brown <broonie@kernel.org>