From: Lance Yang <lance.yang@linux.dev>
To: sarthak.sharma@arm.com
Cc: akpm@linux-foundation.org, david@kernel.org, ljs@kernel.org,
liam@infradead.org, vbabka@kernel.org, rppt@kernel.org,
surenb@google.com, mhocko@suse.com, shuah@kernel.org,
skhan@linuxfoundation.org, corbet@lwn.net, jgg@ziepe.ca,
jhubbard@nvidia.com, peterx@redhat.com, leon@kernel.org,
ziy@nvidia.com, baolin.wang@linux.alibaba.com, npache@redhat.com,
ryan.roberts@arm.com, dev.jain@arm.com, baohua@kernel.org,
lance.yang@linux.dev, broonie@kernel.org,
anshuman.khandual@arm.com, usama.anjum@arm.com,
linux-mm@kvack.org, linux-kselftest@vger.kernel.org,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v8 1/6] selftests/mm: make file helpers return errors
Date: Mon, 31 Aug 2026 12:52:41 +0800 [thread overview]
Message-ID: <20260831045241.25826-1-lance.yang@linux.dev> (raw)
In-Reply-To: <20260831042101.18085-2-sarthak.sharma@arm.com>
On Mon, Aug 31, 2026 at 09:50:56AM +0530, Sarthak Sharma wrote:
[...]
>diff --git a/tools/testing/selftests/mm/vm_util.h b/tools/testing/selftests/mm/vm_util.h
>index 9a49af88702e..62f6f5b42649 100644
>--- a/tools/testing/selftests/mm/vm_util.h
>+++ b/tools/testing/selftests/mm/vm_util.h
>@@ -166,11 +166,11 @@ int unpoison_memory(unsigned long pfn);
> #define PAGEMAP_PRESENT(ent) (((ent) & (1ull << 63)) != 0)
> #define PAGEMAP_PFN(ent) ((ent) & ((1ull << 55) - 1))
>
>-void write_file(const char *path, const char *buf, size_t buflen);
>+int write_file(const char *path, const char *buf, size_t buflen);
> int read_file(const char *path, char *buf, size_t buflen);
>-unsigned long read_num(const char *path);
>-void write_num(const char *path, unsigned long num);
>-void write_num_ignore_einval(const char *path, unsigned long num);
>+int read_num(const char *path, unsigned long *num);
>+int write_num(const char *path, unsigned long num);
>+int write_num_ignore_einval(const char *path, unsigned long num);
Ouch ...
Looks like this conversion misses hugetlb-soft-offline.c ...
TEST_GEN_FILES += hugetlb-soft-offline
int main(int argc, char **argv)
{
...
orig_enable_soft_offline = read_num(ENABLE_SOFT_OFFLINE_PATH);
...
}
And the compiler isn't happy:
tools/testing/selftests/mm/hugetlb-soft-offline.c:199:36:
error: too few arguments to function 'read_num'
199 | orig_enable_soft_offline = read_num(ENABLE_SOFT_OFFLINE_PATH);
tools/lib/mm/file_utils.h:9:5: note: declared here
9 | int read_num(const char *path, unsigned long *num);
Cheers, Lance
[...]
next prev parent reply other threads:[~2026-08-31 4:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-31 4:20 [PATCH v8 0/6] selftests/mm: separate GUP microbenchmarking from functional testing Sarthak Sharma
2026-08-31 4:20 ` [PATCH v8 1/6] selftests/mm: make file helpers return errors Sarthak Sharma
2026-08-31 4:52 ` Lance Yang [this message]
2026-08-31 5:16 ` Sarthak Sharma
2026-08-31 4:20 ` [PATCH v8 2/6] tools/lib/mm: add shared file helpers Sarthak Sharma
2026-08-31 4:20 ` [PATCH v8 3/6] tools/lib/mm: move hugepage_settings out of selftests Sarthak Sharma
2026-08-31 4:20 ` [PATCH v8 4/6] tools/mm: move gup_test from selftests/mm to tools/mm Sarthak Sharma
2026-08-31 4:21 ` [PATCH v8 5/6] tools/mm: make gup_bench a benchmark only tool Sarthak Sharma
2026-08-31 4:21 ` [PATCH v8 6/6] selftests/mm: add a GUP selftest Sarthak Sharma
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260831045241.25826-1-lance.yang@linux.dev \
--to=lance.yang@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=anshuman.khandual@arm.com \
--cc=baohua@kernel.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=broonie@kernel.org \
--cc=corbet@lwn.net \
--cc=david@kernel.org \
--cc=dev.jain@arm.com \
--cc=jgg@ziepe.ca \
--cc=jhubbard@nvidia.com \
--cc=leon@kernel.org \
--cc=liam@infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ljs@kernel.org \
--cc=mhocko@suse.com \
--cc=npache@redhat.com \
--cc=peterx@redhat.com \
--cc=rppt@kernel.org \
--cc=ryan.roberts@arm.com \
--cc=sarthak.sharma@arm.com \
--cc=shuah@kernel.org \
--cc=skhan@linuxfoundation.org \
--cc=surenb@google.com \
--cc=usama.anjum@arm.com \
--cc=vbabka@kernel.org \
--cc=ziy@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox