public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@kernel.org>
To: Matthew Brost <matthew.brost@intel.com>,
	Thomas Hellström <thomas.hellstrom@linux.intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	Michal Wajdeczko <michal.wajdeczko@intel.com>,
	Piotr Piórkowski <piotr.piorkowski@intel.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
	intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH] drm/xe/tests: avoid build warning on 32-bit targets
Date: Wed,  4 Mar 2026 09:37:32 +0100	[thread overview]
Message-ID: <20260304083741.725121-1-arnd@kernel.org> (raw)

From: Arnd Bergmann <arnd@arndb.de>

Building the test case on 32-bit targets produces an integer overflow warning,
as a constant value is assigned to a 32-bit resource_size_t variable:

In file included from drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c:3329:
drivers/gpu/drm/xe/tests/xe_gt_sriov_pf_config_kunit.c: In function 'pf_gt_config_test_init':
drivers/gpu/drm/xe/tests/xe_gt_sriov_pf_config_kunit.c:14:25: error: conversion from 'long long unsigned int' to 'resource_size_t' {aka 'unsigned int'} changes value from '14940110848' to '2055208960' [-Werror=overflow]
   14 | #define TEST_VRAM       0x37a800000ull
      |                         ^~~~~~~~~~~~~~
drivers/gpu/drm/xe/tests/xe_gt_sriov_pf_config_kunit.c:71:29: note: in expansion of macro 'TEST_VRAM'
   71 |         vram->usable_size = TEST_VRAM;
      |                             ^~~~~~~~~

Shut up the warning with an extra cast that marks this truncation as intentional.
This is probably not the right fix here, but I could not figure out where the
constant value actually comes from, or if a smaller number would be appropriate
on a 32-bit system. It's possible that the test case or the driver is just not
useful on 32-bit machines because of other parts of the logic here.

Fixes: cbe29da6f7c0 ("drm/xe/tests: Add KUnit tests for new VRAM fair provisioning")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
If there is a better way to fix this, please treat this as a bug report and
just add a Reported-by tag in the commit.
---
 drivers/gpu/drm/xe/tests/xe_gt_sriov_pf_config_kunit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/xe/tests/xe_gt_sriov_pf_config_kunit.c b/drivers/gpu/drm/xe/tests/xe_gt_sriov_pf_config_kunit.c
index 305dbd4e5d1a..86cd15834bac 100644
--- a/drivers/gpu/drm/xe/tests/xe_gt_sriov_pf_config_kunit.c
+++ b/drivers/gpu/drm/xe/tests/xe_gt_sriov_pf_config_kunit.c
@@ -11,7 +11,7 @@
 #include "xe_pci_test.h"
 
 #define TEST_MAX_VFS	63
-#define TEST_VRAM	0x37a800000ull
+#define TEST_VRAM	(resource_size_t)0x37a800000ull
 
 static void pf_set_admin_mode(struct xe_device *xe, bool enable)
 {
-- 
2.39.5


             reply	other threads:[~2026-03-04  8:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-04  8:37 Arnd Bergmann [this message]
2026-03-04  8:51 ` [PATCH] drm/xe/tests: avoid build warning on 32-bit targets Michal Wajdeczko
2026-03-04  9:06   ` Arnd Bergmann
2026-03-05  3:42 ` Claude review: " Claude Code Review Bot
2026-03-05  3:42 ` Claude Code Review Bot

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=20260304083741.725121-1-arnd@kernel.org \
    --to=arnd@kernel.org \
    --cc=airlied@gmail.com \
    --cc=arnd@arndb.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthew.brost@intel.com \
    --cc=michal.wajdeczko@intel.com \
    --cc=piotr.piorkowski@intel.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=simona@ffwll.ch \
    --cc=thomas.hellstrom@linux.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