public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] tests/xe_madvise: fix cross-compilation error on ARM
@ 2026-04-20  4:43 Arvind Yadav
  2026-04-20  4:58 ` Sharma, Nishit
  2026-04-20 12:57 ` Kamil Konieczny
  0 siblings, 2 replies; 3+ messages in thread
From: Arvind Yadav @ 2026-04-20  4:43 UTC (permalink / raw)
  To: igt-dev; +Cc: nishit.sharma, varun.gupta

Casting a pointer to uint64_t triggers -Werror=pointer-to-int-cast
on 32-bit ARM where sizeof(void *) is 4 but sizeof(uint64_t) is 8.

Use igt_assert(ptr == MAP_FAILED) instead of igt_assert_eq_u64()
which avoids the cast entirely.

Suggested-by: Nishit Sharma <nishit.sharma@intel.com>
Signed-off-by: Varun Gupta <varun.gupta@intel.com>
Signed-off-by: Arvind Yadav <arvind.yadav@intel.com>
---
 tests/intel/xe_madvise.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/intel/xe_madvise.c b/tests/intel/xe_madvise.c
index 805de793a..c728cc5c0 100644
--- a/tests/intel/xe_madvise.c
+++ b/tests/intel/xe_madvise.c
@@ -198,7 +198,7 @@ static void test_purged_mmap_blocked(int fd)
 	igt_assert_eq(igt_ioctl(fd, DRM_IOCTL_XE_GEM_MMAP_OFFSET, &mmo), 0);
 
 	ptr = mmap(NULL, bo_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, mmo.offset);
-	igt_assert_eq_u64((uint64_t)ptr, (uint64_t)MAP_FAILED);
+	igt_assert(ptr == MAP_FAILED);
 	igt_assert_eq(errno, EINVAL);
 
 	gem_close(fd, bo);
@@ -340,7 +340,7 @@ static void test_dontneed_before_mmap(int fd)
 
 	/* mmap() on a DONTNEED BO must fail with EBUSY. */
 	ptr = mmap(NULL, bo_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, mmo.offset);
-	igt_assert_eq_u64((uint64_t)ptr, (uint64_t)MAP_FAILED);
+	igt_assert(ptr == MAP_FAILED);
 	igt_assert_eq(errno, EBUSY);
 
 	/* Restore to WILLNEED before cleanup */
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-04-20 12:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-20  4:43 [PATCH] tests/xe_madvise: fix cross-compilation error on ARM Arvind Yadav
2026-04-20  4:58 ` Sharma, Nishit
2026-04-20 12:57 ` Kamil Konieczny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox