diff mbox

drm/i915: fix build warning on format specifier mismatch

Message ID 1370610230-27235-1-git-send-email-jani.nikula@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jani Nikula June 7, 2013, 1:03 p.m. UTC
drivers/gpu/drm/i915/i915_gem.c: In function ‘i915_gem_object_bind_to_gtt’:
drivers/gpu/drm/i915/i915_gem.c:3002:3: warning: format ‘%ld’ expects
argument of type ‘long int’, but argument 5 has type ‘size_t’ [-Wformat]

v2: Use %zu instead of %d. Two char patch, and 100% wrong. (Ville)

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/i915_gem.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ville Syrjälä June 11, 2013, 6:57 a.m. UTC | #1
On Fri, Jun 07, 2013 at 04:03:50PM +0300, Jani Nikula wrote:
> drivers/gpu/drm/i915/i915_gem.c: In function ‘i915_gem_object_bind_to_gtt’:
> drivers/gpu/drm/i915/i915_gem.c:3002:3: warning: format ‘%ld’ expects
> argument of type ‘long int’, but argument 5 has type ‘size_t’ [-Wformat]
> 
> v2: Use %zu instead of %d. Two char patch, and 100% wrong. (Ville)
> 
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

> ---
>  drivers/gpu/drm/i915/i915_gem.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index 58048d4..c2b60a4 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -2999,7 +2999,7 @@ i915_gem_object_bind_to_gtt(struct drm_i915_gem_object *obj,
>  	 * before evicting everything in a vain attempt to find space.
>  	 */
>  	if (obj->base.size > gtt_max) {
> -		DRM_ERROR("Attempting to bind an object larger than the aperture: object=%zd > %s aperture=%ld\n",
> +		DRM_ERROR("Attempting to bind an object larger than the aperture: object=%zd > %s aperture=%zu\n",
>  			  obj->base.size,
>  			  map_and_fenceable ? "mappable" : "total",
>  			  gtt_max);
> -- 
> 1.7.9.5
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Daniel Vetter June 24, 2013, 6:37 p.m. UTC | #2
On Tue, Jun 11, 2013 at 09:57:26AM +0300, Ville Syrjälä wrote:
> On Fri, Jun 07, 2013 at 04:03:50PM +0300, Jani Nikula wrote:
> > drivers/gpu/drm/i915/i915_gem.c: In function ‘i915_gem_object_bind_to_gtt’:
> > drivers/gpu/drm/i915/i915_gem.c:3002:3: warning: format ‘%ld’ expects
> > argument of type ‘long int’, but argument 5 has type ‘size_t’ [-Wformat]
> > 
> > v2: Use %zu instead of %d. Two char patch, and 100% wrong. (Ville)
> > 
> > Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> 
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Queued for -next, thanks for the patch.
-Daniel
> 
> > ---
> >  drivers/gpu/drm/i915/i915_gem.c |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> > index 58048d4..c2b60a4 100644
> > --- a/drivers/gpu/drm/i915/i915_gem.c
> > +++ b/drivers/gpu/drm/i915/i915_gem.c
> > @@ -2999,7 +2999,7 @@ i915_gem_object_bind_to_gtt(struct drm_i915_gem_object *obj,
> >  	 * before evicting everything in a vain attempt to find space.
> >  	 */
> >  	if (obj->base.size > gtt_max) {
> > -		DRM_ERROR("Attempting to bind an object larger than the aperture: object=%zd > %s aperture=%ld\n",
> > +		DRM_ERROR("Attempting to bind an object larger than the aperture: object=%zd > %s aperture=%zu\n",
> >  			  obj->base.size,
> >  			  map_and_fenceable ? "mappable" : "total",
> >  			  gtt_max);
> > -- 
> > 1.7.9.5
> > 
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
> 
> -- 
> Ville Syrjälä
> Intel OTC
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 58048d4..c2b60a4 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2999,7 +2999,7 @@  i915_gem_object_bind_to_gtt(struct drm_i915_gem_object *obj,
 	 * before evicting everything in a vain attempt to find space.
 	 */
 	if (obj->base.size > gtt_max) {
-		DRM_ERROR("Attempting to bind an object larger than the aperture: object=%zd > %s aperture=%ld\n",
+		DRM_ERROR("Attempting to bind an object larger than the aperture: object=%zd > %s aperture=%zu\n",
 			  obj->base.size,
 			  map_and_fenceable ? "mappable" : "total",
 			  gtt_max);