Skip to contentSkip to conversation

drm/i915: Fix build warning on 32-bit

PATCH Applied Thierry Reding 5 participants 6 messages Aug 14, 2015 – Aug 26, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915: Fix build warning on 32-bit

From: Thierry Reding <[email protected]>

The gtt.stolen_size field is of type size_t, and so should be printed using %zu to avoid build warnings on either 32-bit and 64-bit builds.

---
 drivers/gpu/drm/i915/i915_gem_stolen.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_gem_stolen.c +1 -1
index a36cb95ec798..f361c4a56995 100644
@@ -348,7 +348,7 @@ int i915_gem_init_stolen(struct drm_device *dev)
 	 * memory, so just consider the start. */
 	reserved_total = stolen_top - reserved_base;
 
-	DRM_DEBUG_KMS("Memory reserved for graphics device: %luK, usable: %luK\n",
+	DRM_DEBUG_KMS("Memory reserved for graphics device: %zuK, usable: %luK\n",
 		      dev_priv->gtt.stolen_size >> 10,
 		      (dev_priv->gtt.stolen_size - reserved_total) >> 10);
 
Signature · 6 lines
2.4.5

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw
Quoted 4 lines · Thierry Reding

From: Thierry Reding <[email protected]>

The gtt.stolen_size field is of type size_t, and so should be printed using %zu to avoid build warnings on either 32-bit and 64-bit builds.

Or better would be to convert stolen.size to u32 so that we know that it is correctly sized for the hardware irrespective of the compilation environment.
-Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#2 lore raw
In reply to Thierry Reding

Em Sex, 2015-08-14 às 12:35 +0200, Thierry Reding escreveu:

Quoted 4 lines

From: Thierry Reding <[email protected]>

The gtt.stolen_size field is of type size_t, and so should be printed using %zu to avoid build warnings on either 32-bit and 64-bit builds.

While the suggestion from Chris sounds good, this patch alone is already a fix, so:

Quoted 20 lines
---
 drivers/gpu/drm/i915/i915_gem_stolen.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_gem_stolen.c +1 -1
index a36cb95ec798..f361c4a56995 100644
@@ -348,7 +348,7 @@ int i915_gem_init_stolen(struct drm_device *dev)
 	 * memory, so just consider the start. */
 	reserved_total = stolen_top - reserved_base;
 
-	DRM_DEBUG_KMS("Memory reserved for graphics device: %luK, 
 usable: %luK\n",
+	DRM_DEBUG_KMS("Memory reserved for graphics device: %zuK, 
 usable: %luK\n",
 		      dev_priv->gtt.stolen_size >> 10,
Quoted 3 lines

(dev_priv->gtt.stolen_size - reserved_total)

Quoted 1 line
Quoted 1 line

10);

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#3 lore raw
Quoted 9 lines · Paulo R

Em Sex, 2015-08-14 às 12:35 +0200, Thierry Reding escreveu:

Quoted 4 lines

From: Thierry Reding <[email protected]>

The gtt.stolen_size field is of type size_t, and so should be printed using %zu to avoid build warnings on either 32-bit and 64-bit builds.

While the suggestion from Chris sounds good, this patch alone is already a fix, so:

Queued for -next, thanks for the patch.
-Daniel

Quoted 28 lines
Quoted 21 lines
---
 drivers/gpu/drm/i915/i915_gem_stolen.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_gem_stolen.c +1 -1
index a36cb95ec798..f361c4a56995 100644
@@ -348,7 +348,7 @@ int i915_gem_init_stolen(struct drm_device *dev)
 	 * memory, so just consider the start. */
 	reserved_total = stolen_top - reserved_base;
 
-	DRM_DEBUG_KMS("Memory reserved for graphics device: %luK, 
 usable: %luK\n",
+	DRM_DEBUG_KMS("Memory reserved for graphics device: %zuK, 
 usable: %luK\n",
 		      dev_priv->gtt.stolen_size >> 10,
Quoted 3 lines

(dev_priv->gtt.stolen_size - reserved_total)

Quoted 1 line
Quoted 1 line

10);

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer
#4 lore raw
Quoted 4 lines · Daniel Vetter
Quoted 3 lines · Paulo R

Em Sex, 2015-08-14 às 12:35 +0200, Thierry Reding escreveu:

Quoted 2 lines

From: Thierry Reding <[email protected]>

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

The gtt.stolen_size field is of type size_t, and so should be printed using %zu to avoid build warnings on either 32-bit and 64-bit builds.

While the suggestion from Chris sounds good, this patch alone is already a fix, so:

Queued for -next, thanks for the patch.

Great. Also pushed to drm-intel-next-fixes.

Jani.

Quoted 39 lines

-Daniel

Quoted 28 lines
Quoted 21 lines
---
 drivers/gpu/drm/i915/i915_gem_stolen.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_gem_stolen.c +1 -1
index a36cb95ec798..f361c4a56995 100644
@@ -348,7 +348,7 @@ int i915_gem_init_stolen(struct drm_device *dev)
 	 * memory, so just consider the start. */
 	reserved_total = stolen_top - reserved_base;
 
-	DRM_DEBUG_KMS("Memory reserved for graphics device: %luK, 
 usable: %luK\n",
+	DRM_DEBUG_KMS("Memory reserved for graphics device: %zuK, 
 usable: %luK\n",
 		      dev_priv->gtt.stolen_size >> 10,
Quoted 3 lines

(dev_priv->gtt.stolen_size - reserved_total)

Quoted 1 line
Quoted 1 line

10);

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#5 lore raw
Quoted 8 lines · Jani Nikula
Quoted 7 lines · Daniel Vetter
Quoted 6 lines · Paulo R

Em Sex, 2015-08-14 às 12:35 +0200, Thierry Reding escreveu:

Quoted 4 lines

From: Thierry Reding <[email protected]>

The gtt.stolen_size field is of type size_t, and so should be printed using %zu to avoid build warnings on either 32-bit and 64-bit builds.

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

While the suggestion from Chris sounds good, this patch alone is already a fix, so:

Queued for -next, thanks for the patch.

Great. Also pushed to drm-intel-next-fixes.

Oops, dropped again from dinq ;-)
-Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx