Hi Li,

This is breaking the mm-new mm selftest test build, did you have some local
changes you didn't submit by mistake?

You seem to be returning KSFT_SKIP from a void function.

I enclose a simple fix-patch that fixes the issue, but obviously you should
check to see if this is still doing what you want :)

Cheers, Lorenzo

On Sat, Jun 21, 2025 at 08:48:08AM +0800, Li Wang wrote:
[snip]
> diff --git a/tools/testing/selftests/mm/soft-dirty.c 
> b/tools/testing/selftests/mm/soft-dirty.c
> index 8e1462ce0532..72d8ded87756 100644
> --- a/tools/testing/selftests/mm/soft-dirty.c
> +++ b/tools/testing/selftests/mm/soft-dirty.c
> @@ -6,8 +6,10 @@
>  #include <stdint.h>
>  #include <malloc.h>
>  #include <sys/mman.h>
> +
>  #include "../kselftest.h"
>  #include "vm_util.h"
> +#include "thp_settings.h"
>
>  #define PAGEMAP_FILE_PATH "/proc/self/pagemap"
>  #define TEST_ITERATIONS 10000
> @@ -78,8 +80,13 @@ static void test_hugepage(int pagemap_fd, int pagesize)
>  {
>       char *map;
>       int i, ret;
> -     size_t hpage_len = read_pmd_pagesize();
>
> +     if (!thp_is_enabled()) {
> +             printf("Skipping test: Transparent Hugepages not available\n");
> +             return KSFT_SKIP;

                ^---- Returning a value in a void function?

----8<----
>From cf6643f4232da4a7014082363896a2cf56eaa88e Mon Sep 17 00:00:00 2001
From: Lorenzo Stoakes <lorenzo.stoa...@oracle.com>
Date: Mon, 23 Jun 2025 09:59:28 +0100
Subject: [PATCH] fix

Signed-off-by: Lorenzo Stoakes <lorenzo.stoa...@oracle.com>
---
 tools/testing/selftests/mm/soft-dirty.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/mm/soft-dirty.c 
b/tools/testing/selftests/mm/soft-dirty.c
index 72d8ded87756..c0b34cf75205 100644
--- a/tools/testing/selftests/mm/soft-dirty.c
+++ b/tools/testing/selftests/mm/soft-dirty.c
@@ -82,8 +82,8 @@ static void test_hugepage(int pagemap_fd, int pagesize)
        int i, ret;

        if (!thp_is_enabled()) {
-               printf("Skipping test: Transparent Hugepages not available\n");
-               return KSFT_SKIP;
+               ksft_test_result_skip("Skipping test: Transparent Hugepages not 
available\n");
+               return;
        }

        size_t hpage_len = read_pmd_pagesize();
--
2.50.0

Reply via email to