From nobody Mon Apr 13 21:01:04 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AA513390C9A for ; Wed, 4 Mar 2026 08:37:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772613466; cv=none; b=QthND0/CMwKG2+xO+O5JotAjuB/EyJGDZK/sVD6At5A/RHfk6x105+rCKSPlFj7+QO2lk7CfqaMbydyui6Okf8HGn+SlFngA1mS2qm2lz7AhZLlkvheK2YRPurb7eHczj8hwiTJEWdqBkIAD3//W7ALND202anbD019lfPSPIew= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772613466; c=relaxed/simple; bh=qOZfFUlUOEVKoYXfHRfZIknRLCKlJk0u8y49Q5mlMhA=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=Rv8b3Zmcn/Mg01yACcx1xlY/61ce99G0EKOrQ68xO/pXZYhHUbdHRlfFQWqs+PoPgBa88BnwQLftuH19x/y8+qBpYWlP585pAXx0mJvh2Pb55Qoeb0gPW/7BqN6D1VoiCWq4f1NIREExVAxzNjNmcwhsj3SWq9QNT8tyJ9u4Cjg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Gdf7iAgX; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Gdf7iAgX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3C985C19423; Wed, 4 Mar 2026 08:37:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772613466; bh=qOZfFUlUOEVKoYXfHRfZIknRLCKlJk0u8y49Q5mlMhA=; h=From:To:Cc:Subject:Date:From; b=Gdf7iAgXEPqFOG+Jmz13KtJoBIC6+erQteO+lxEZVpL7qLioqwGfwiHgTER+TcNvR TxNbnH+Rdd/UIiwGC0gjMBLVNenc1q0JpMVkwbdFNe6Sdwz2XMU7ERJ3KA7bIZ1jr5 g6nN1B+s8ypsjl6ivDlwuWQ14m2ealh605vKPr5FR1BJv8FSD/jv8PSAwvuRjRQa+n O6lYcn75/j3ux4ZD+jUiXRcKAMYEsqls3XBXOxjii9/TU3axtVmPTR99wARI5RXrHy L2VginSP3/dWvjQMJ0BYWMMsxMjOe6C/3N7VlMjlyT592hkgkai1m7VBpWfISnfUU2 e2+SBAYcPkang== From: Arnd Bergmann To: Matthew Brost , =?UTF-8?q?Thomas=20Hellstr=C3=B6m?= , Rodrigo Vivi , David Airlie , Simona Vetter , Michal Wajdeczko , =?UTF-8?q?Piotr=20Pi=C3=B3rkowski?= Cc: Arnd Bergmann , 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 Message-Id: <20260304083741.725121-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.5 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Arnd Bergmann Building the test case on 32-bit targets produces an integer overflow warni= ng, 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: conver= sion from 'long long unsigned int' to 'resource_size_t' {aka 'unsigned int'= } changes value from '14940110848' to '2055208960' [-Werror=3Doverflow] 14 | #define TEST_VRAM 0x37a800000ull | ^~~~~~~~~~~~~~ drivers/gpu/drm/xe/tests/xe_gt_sriov_pf_config_kunit.c:71:29: note: in expa= nsion of macro 'TEST_VRAM' 71 | vram->usable_size =3D TEST_VRAM; | ^~~~~~~~~ Shut up the warning with an extra cast that marks this truncation as intent= ional. This is probably not the right fix here, but I could not figure out where t= he constant value actually comes from, or if a smaller number would be appropr= iate 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 provi= sioning") Signed-off-by: Arnd Bergmann --- 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/drive= rs/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" =20 #define TEST_MAX_VFS 63 -#define TEST_VRAM 0x37a800000ull +#define TEST_VRAM (resource_size_t)0x37a800000ull =20 static void pf_set_admin_mode(struct xe_device *xe, bool enable) { --=20 2.39.5