From: "Sharma, Nishit" <nishit.sharma@intel.com>
To: Arvind Yadav <arvind.yadav@intel.com>, <igt-dev@lists.freedesktop.org>
Cc: <varun.gupta@intel.com>
Subject: Re: [PATCH] tests/xe_madvise: fix cross-compilation error on ARM
Date: Mon, 20 Apr 2026 10:28:31 +0530 [thread overview]
Message-ID: <89ca0bec-9d56-40d8-922f-b7e38a81ca4c@intel.com> (raw)
In-Reply-To: <20260420044339.3171967-1-arvind.yadav@intel.com>
On 4/20/2026 10:13 AM, Arvind Yadav wrote:
> 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 */
LGTM:
Reviewed-by: Nishit Sharma <nishit.sharma@intel.com>
next prev parent reply other threads:[~2026-04-20 4:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-20 4:43 [PATCH] tests/xe_madvise: fix cross-compilation error on ARM Arvind Yadav
2026-04-20 4:58 ` Sharma, Nishit [this message]
2026-04-20 12:57 ` Kamil Konieczny
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=89ca0bec-9d56-40d8-922f-b7e38a81ca4c@intel.com \
--to=nishit.sharma@intel.com \
--cc=arvind.yadav@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=varun.gupta@intel.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