[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20211215140552.581719-1-arnd@kernel.org>
Date: Wed, 15 Dec 2021 15:05:40 +0100
From: Arnd Bergmann <arnd@...nel.org>
To: VMware Graphics <linux-graphics-maintainer@...are.com>,
Zack Rusin <zackr@...are.com>, David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>,
Martin Krastev <krastevm@...are.com>
Cc: Arnd Bergmann <arnd@...db.de>, dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] drm/vmwgfx: fix size_t format string
From: Arnd Bergmann <arnd@...db.de>
On architectures with size_t different from 'unsigned long', gcc
prints this warning:
drivers/gpu/drm/vmwgfx/vmwgfx_gem.c: In function 'vmw_bo_print_info':
drivers/gpu/drm/vmwgfx/vmwgfx_gem.c:230:40: error: format '%ld' expects argument of type 'long int', but argument 4 has type 'size_t' {aka 'unsigned int'} [-Werror=format=]
230 | seq_printf(m, "\t\t0x%08x: %12ld bytes %s, type = %s",
| ~~~~^
| |
| long int
| %12d
231 | id, bo->base.base.size, placement, type);
| ~~~~~~~~~~~~~~~~~~
| |
| size_t {aka unsigned int}
Use the correct %zd modifier.
Fixes: 8afa13a0583f ("drm/vmwgfx: Implement DRIVER_GEM")
Signed-off-by: Arnd Bergmann <arnd@...db.de>
---
drivers/gpu/drm/vmwgfx/vmwgfx_gem.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_gem.c b/drivers/gpu/drm/vmwgfx/vmwgfx_gem.c
index c016c434b6cb..3d4d703b20a8 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_gem.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_gem.c
@@ -227,7 +227,7 @@ static void vmw_bo_print_info(int id, struct vmw_buffer_object *bo, struct seq_f
break;
}
- seq_printf(m, "\t\t0x%08x: %12ld bytes %s, type = %s",
+ seq_printf(m, "\t\t0x%08x: %12zd bytes %s, type = %s",
id, bo->base.base.size, placement, type);
seq_printf(m, ", priority = %u, pin_count = %u, GEM refs = %d, TTM refs = %d",
bo->base.priority,
--
2.29.2
Powered by blists - more mailing lists