Skip to content

Commit 9d789c3

Browse files
davidhildenbrandakpm00
authored andcommitted
selftests/vm: ksm_functional_tests: fixes for 32bit
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". Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: David Hildenbrand <[email protected]> Cc: Shuah Khan <[email protected]> Cc: Yang Li <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 380969f commit 9d789c3

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

tools/testing/selftests/vm/ksm_functional_tests.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ static bool range_maps_duplicates(char *addr, unsigned long size)
4242
for (offs_a = 0; offs_a < size; offs_a += pagesize) {
4343
pfn_a = pagemap_get_pfn(pagemap_fd, addr + offs_a);
4444
/* Page not present or PFN not exposed by the kernel. */
45-
if (pfn_a == -1ull || !pfn_a)
45+
if (pfn_a == -1ul || !pfn_a)
4646
continue;
4747

4848
for (offs_b = offs_a + pagesize; offs_b < size;
4949
offs_b += pagesize) {
5050
pfn_b = pagemap_get_pfn(pagemap_fd, addr + offs_b);
51-
if (pfn_b == -1ull || !pfn_b)
51+
if (pfn_b == -1ul || !pfn_b)
5252
continue;
5353
if (pfn_a == pfn_b)
5454
return true;

tools/testing/selftests/vm/vm_util.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ unsigned long pagemap_get_pfn(int fd, char *start)
5050
/* If present (63th bit), PFN is at bit 0 -- 54. */
5151
if (entry & 0x8000000000000000ull)
5252
return entry & 0x007fffffffffffffull;
53-
return -1ull;
53+
return -1ul;
5454
}
5555

5656
void clear_softdirty(void)

0 commit comments

Comments
 (0)