diff mbox

drm/vc4: fix build warning

Message ID 1450856198-27306-1-git-send-email-sudipm.mukherjee@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Sudip Mukherjee Dec. 23, 2015, 7:36 a.m. UTC
We were getting build warning:

drivers/gpu/drm/vc4/vc4_validate.c: In function 'validate_gl_shader_rec':
drivers/gpu/drm/vc4/vc4_validate.c:864:4:
warning: format '%d' expects argument of type 'int', but argument 4 has type 'size_t' [-Wformat=]
DRM_ERROR("BO offset overflow (%d + %d > %d)\n",

vbo->base.size is size_t and for printing size_t we should be using %zu.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
 drivers/gpu/drm/vc4/vc4_validate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Eric Anholt Dec. 24, 2015, 11:50 p.m. UTC | #1
Sudip Mukherjee <sudipm.mukherjee@gmail.com> writes:

> We were getting build warning:
>
> drivers/gpu/drm/vc4/vc4_validate.c: In function 'validate_gl_shader_rec':
> drivers/gpu/drm/vc4/vc4_validate.c:864:4:
> warning: format '%d' expects argument of type 'int', but argument 4 has type 'size_t' [-Wformat=]
> DRM_ERROR("BO offset overflow (%d + %d > %d)\n",
>
> vbo->base.size is size_t and for printing size_t we should be using %zu.
>
> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>

Reviewed-by: Eric Anholt <eric@anholt.net>

and I've pulled it for the next round of fixes.
diff mbox

Patch

diff --git a/drivers/gpu/drm/vc4/vc4_validate.c b/drivers/gpu/drm/vc4/vc4_validate.c
index 0fb5b99..e26d9f6 100644
--- a/drivers/gpu/drm/vc4/vc4_validate.c
+++ b/drivers/gpu/drm/vc4/vc4_validate.c
@@ -861,7 +861,7 @@  validate_gl_shader_rec(struct drm_device *dev,
 
 		if (vbo->base.size < offset ||
 		    vbo->base.size - offset < attr_size) {
-			DRM_ERROR("BO offset overflow (%d + %d > %d)\n",
+			DRM_ERROR("BO offset overflow (%d + %d > %zu)\n",
 				  offset, attr_size, vbo->base.size);
 			return -EINVAL;
 		}