drm/vc4: use %z format string for size_t
Subsystems (3)
PATCH 1/1 drm/vc4: use %z format string for size_t
Printing a size_t variable needs to use the %z format string modifier rather than %l, otherwise we get this warning on 64-bit architectures:
drivers/gpu/drm/vc4/vc4_bo.c: In function 'vc4_bo_stats_debugfs':drivers/gpu/drm/vc4/vc4_bo.c:91:26: error: format '%d' expects argument of type 'int', but argument 4 has type 'size_t {aka long unsigned int}' [-Werror=format=]
--- drivers/gpu/drm/vc4/vc4_bo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/vc4/vc4_bo.c +2 -2
@@ -88,11 +88,11 @@ int vc4_bo_stats_debugfs(struct seq_file *m, void *unused)mutex_lock (&vc4->purgeable.lock);if (vc4->purgeable.num) -seq_printf (m,"%30s: %6dkb BOs (%d)\n" ,"userspace BO cache" , +seq_printf (m,"%30s: %6zdkb BOs (%d)\n" ,"userspace BO cache" , vc4->purgeable.size /1024 , vc4->purgeable.num);if (vc4->purgeable.purged_num) -seq_printf (m,"%30s: %6dkb BOs (%d)\n" ,"total purged BO" , +seq_printf (m,"%30s: %6zdkb BOs (%d)\n" ,"total purged BO" , vc4->purgeable.purged_size /1024 , vc4->purgeable.purged_num);mutex_unlock (&vc4->purgeable.lock);
Signature · 6 lines
2.9.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Hi Arnd,
Quoted 6 lines · On Thu, 2 Nov 2017 12:20:43 +0100 Arnd Bergmann <[email protected]> wrote:
Printing a
size_tvariable needs to use the %z format string modifier rather than %l, otherwise we get this warning on 64-bit architectures:
drivers/gpu/drm/vc4/vc4_bo.c: In function 'vc4_bo_stats_debugfs':drivers/gpu/drm/vc4/vc4_bo.c:91:26: error: format '%d' expects argument of type 'int', but argument 4 has type 'size_t{aka long unsigned int}' [-Werror=format=]
I already sent (and applied) a fix for this bug [1].
Regards,
Boris
[1]https://patchwork.kernel.org/patch/10036075/
Quoted 14 lines
Fixes b9f19259b84d ("drm/vc4: Add the DRM_IOCTL_VC4_GEM_MADVISE ioctl")Signed-off-by Arnd Bergmann <[email protected]>--- drivers/gpu/drm/vc4/vc4_bo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/vc4/vc4_bo.c +0
-0@@ -88,11 +88,11 @@ int vc4_bo_stats_debugfs(struct seq_file *m, void *unused)mutex_lock (&vc4->purgeable.lock);if (vc4->purgeable.num)
drivers/gpu/drm/vc4/vc4_bo.c int vc4_bo_stats_debugfs(struct seq_file *m, void *unused) · line 98
Quoted 10 lines
drivers/gpu/drm/vc4/vc4_bo.c +2
-2-seq_printf (m,"%30s: %6dkb BOs (%d)\n" ,"userspace BO cache" , +seq_printf (m,"%30s: %6zdkb BOs (%d)\n" ,"userspace BO cache" , vc4->purgeable.size /1024 , vc4->purgeable.num);if (vc4->purgeable.purged_num) -seq_printf (m,"%30s: %6dkb BOs (%d)\n" ,"total purged BO" , +seq_printf (m,"%30s: %6zdkb BOs (%d)\n" ,"total purged BO" , vc4->purgeable.purged_size /1024 , vc4->purgeable.purged_num);mutex_unlock (&vc4->purgeable.lock);
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel