From: David Hildenbrand <david@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: linux-mm@kvack.org, linux-kselftest@vger.kernel.org,
David Hildenbrand <david@redhat.com>,
Andrew Morton <akpm@linux-foundation.org>,
Shuah Khan <shuah@kernel.org>,
Yang Li <yang.lee@linux.alibaba.com>
Subject: [PATCH mm-unstable v1 4/4] selftests/vm: ksm_functional_tests: fixes for 32bit
Date: Mon, 5 Dec 2022 20:37:16 +0100 [thread overview]
Message-ID: <20221205193716.276024-5-david@redhat.com> (raw)
In-Reply-To: <20221205193716.276024-1-david@redhat.com>
The test currently fails on 32bit. Fixing the "-1ull" vs. "-1ul" seems
to make the test pass and the compiler happy.
Note: This test is not in mm-stable yet. This fix should be squashed into
"selftests/vm: add KSM unmerge tests".
Signed-off-by: David Hildenbrand <david@redhat.com>
---
tools/testing/selftests/vm/ksm_functional_tests.c | 4 ++--
tools/testing/selftests/vm/vm_util.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/testing/selftests/vm/ksm_functional_tests.c b/tools/testing/selftests/vm/ksm_functional_tests.c
index 96644be68962..b11b7e5115dc 100644
--- a/tools/testing/selftests/vm/ksm_functional_tests.c
+++ b/tools/testing/selftests/vm/ksm_functional_tests.c
@@ -42,13 +42,13 @@ static bool range_maps_duplicates(char *addr, unsigned long size)
for (offs_a = 0; offs_a < size; offs_a += pagesize) {
pfn_a = pagemap_get_pfn(pagemap_fd, addr + offs_a);
/* Page not present or PFN not exposed by the kernel. */
- if (pfn_a == -1ull || !pfn_a)
+ if (pfn_a == -1ul || !pfn_a)
continue;
for (offs_b = offs_a + pagesize; offs_b < size;
offs_b += pagesize) {
pfn_b = pagemap_get_pfn(pagemap_fd, addr + offs_b);
- if (pfn_b == -1ull || !pfn_b)
+ if (pfn_b == -1ul || !pfn_b)
continue;
if (pfn_a == pfn_b)
return true;
diff --git a/tools/testing/selftests/vm/vm_util.c b/tools/testing/selftests/vm/vm_util.c
index 710571902743..40e795624ff3 100644
--- a/tools/testing/selftests/vm/vm_util.c
+++ b/tools/testing/selftests/vm/vm_util.c
@@ -50,7 +50,7 @@ unsigned long pagemap_get_pfn(int fd, char *start)
/* If present (63th bit), PFN is at bit 0 -- 54. */
if (entry & 0x8000000000000000ull)
return entry & 0x007fffffffffffffull;
- return -1ull;
+ return -1ul;
}
void clear_softdirty(void)
--
2.38.1
prev parent reply other threads:[~2022-12-05 19:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-05 19:37 [PATCH mm-unstable v1 0/4] selftests/vm: fix some tests on 32bit David Hildenbrand
2022-12-05 19:37 ` [PATCH mm-unstable v1 1/4] mm/gup_test: fix PIN_LONGTERM_TEST_READ with highmem David Hildenbrand
2022-12-05 19:37 ` [PATCH mm-unstable v1 2/4] selftests/vm: madv_populate: fix missing MADV_POPULATE_(READ|WRITE) definitions David Hildenbrand
2022-12-05 19:37 ` [PATCH mm-unstable v1 3/4] selftests/vm: cow: fix compile warning on 32bit David Hildenbrand
2022-12-05 19:37 ` David Hildenbrand [this message]
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=20221205193716.276024-5-david@redhat.com \
--to=david@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=shuah@kernel.org \
--cc=yang.lee@linux.alibaba.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;
as well as URLs for NNTP newsgroup(s).