Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Andi Shyti <andi.shyti@linux.intel.com>
To: intel-gfx <intel-gfx@lists.freedesktop.org>,
	dri-devel <dri-devel@lists.freedesktop.org>
Cc: Andi Shyti <andi.shyti@linux.intel.com>,
	Jonathan Cavitt <jonathan.cavitt@intel.com>,
	Lucas De Marchi <lucas.demarchi@intel.com>
Subject: [PATCH v2 2/2] drm/i915/gem: Use the correct format specifier for resource_size_t
Date: Mon, 17 Jun 2024 20:42:43 +0200	[thread overview]
Message-ID: <20240617184243.330231-3-andi.shyti@linux.intel.com> (raw)
In-Reply-To: <20240617184243.330231-1-andi.shyti@linux.intel.com>

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(-)

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);
-- 
2.45.1


  parent reply	other threads:[~2024-06-17 18:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-17 18:42 [PATCH v2 0/2] Sparse errors on the i915_gem_stolen Andi Shyti
2024-06-17 18:42 ` [PATCH v2 1/2] drm/i915/gem: Return NULL instead of '0' Andi Shyti
2024-06-27 13:28   ` Lucas De Marchi
2024-06-17 18:42 ` Andi Shyti [this message]
2024-06-27 13:27   ` [PATCH v2 2/2] drm/i915/gem: Use the correct format specifier for resource_size_t Lucas De Marchi
2024-06-17 19:37 ` ✓ Fi.CI.BAT: success for Sparse errors on the i915_gem_stolen (rev2) Patchwork
2024-06-18  8:43 ` ✓ Fi.CI.IGT: " Patchwork
2024-06-18 19:34 ` [PATCH v2 0/2] Sparse errors on the i915_gem_stolen Cavitt, Jonathan
2024-06-19 10:56   ` Andi Shyti

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=20240617184243.330231-3-andi.shyti@linux.intel.com \
    --to=andi.shyti@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jonathan.cavitt@intel.com \
    --cc=lucas.demarchi@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