diff mbox series

[v2,2/2] drm/i915/gem: Use the correct format specifier for resource_size_t

Message ID 20240617184243.330231-3-andi.shyti@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series Sparse errors on the i915_gem_stolen | expand

Commit Message

Andi Shyti June 17, 2024, 6:42 p.m. UTC
Commit 05da7d9f717b ("drm/i915/gem: Downgrade stolen lmem setup
warning") adds a debug message where the "lmem_size" and
"dsm_base" variables are printed using the %lli identifier.

However, these variables are defined as resource_size_t, which
are unsigned long for 32-bit machines and unsigned long long for
64-bit machines.

The documentation (core-api/printk-formats.rst) recommends using
the %pa specifier for printing addresses and sizes of resources.

Replace %lli with %pa.

This patch also mutes the following sparse warning when compiling
with:

   make W=1 ARCH=i386 drivers/gpu/drm/i915

>> drivers/gpu/drm/i915/gem/i915_gem_stolen.c:941:5: error: format '%lli'
   expects argument of type 'long long int', but argument 5 has type
   'resource_size_t' {aka 'unsigned int'} [-Werror=format=]

Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
Cc: Jonathan Cavitt <jonathan.cavitt@intel.com>
---
Cc: Lucas De Marchi <lucas.demarchi@intel.com>

 drivers/gpu/drm/i915/gem/i915_gem_stolen.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Lucas De Marchi June 27, 2024, 1:27 p.m. UTC | #1
On Mon, Jun 17, 2024 at 08:42:43PM GMT, Andi Shyti wrote:
>Commit 05da7d9f717b ("drm/i915/gem: Downgrade stolen lmem setup
>warning") adds a debug message where the "lmem_size" and
>"dsm_base" variables are printed using the %lli identifier.
>
>However, these variables are defined as resource_size_t, which
>are unsigned long for 32-bit machines and unsigned long long for
>64-bit machines.
>
>The documentation (core-api/printk-formats.rst) recommends using
>the %pa specifier for printing addresses and sizes of resources.
>
>Replace %lli with %pa.
>
>This patch also mutes the following sparse warning when compiling
>with:

s/sparse//

I will do that while applying, thanks.

Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>

Lucas De Marchi
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_stolen.c b/drivers/gpu/drm/i915/gem/i915_gem_stolen.c
index 9ca73936dc5e..d29005980806 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_stolen.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_stolen.c
@@ -938,8 +938,8 @@  i915_gem_stolen_lmem_setup(struct drm_i915_private *i915, u16 type,
 		dsm_base = intel_uncore_read64(uncore, GEN6_DSMBASE) & GEN11_BDSM_MASK;
 		if (lmem_size < dsm_base) {
 			drm_dbg(&i915->drm,
-				"Disabling stolen memory support due to OOB placement: lmem_size = %lli vs dsm_base = %lli\n",
-				lmem_size, dsm_base);
+				"Disabling stolen memory support due to OOB placement: lmem_size = %pa vs dsm_base = %pa\n",
+				&lmem_size, &dsm_base);
 			return NULL;
 		}
 		dsm_size = ALIGN_DOWN(lmem_size - dsm_base, SZ_1M);