Skip to content

Commit

Permalink
drm/msm: use %z format modifier for printing size_t
Browse files Browse the repository at this point in the history
The return type of ARRAY_SIZE() is size_t, so we have to use
%zu instead of %lu to avoid this warning:

drivers/gpu/drm/msm/msm_gpu.c: In function 'msm_gpu_init':
drivers/gpu/drm/msm/msm_gpu.c:742:31: error: format '%lu' expects argument of type 'long unsigned int', but argument 7 has type 'unsigned int' [-Werror=format=]

The warning it otherwise harmless as size_t is always the
same size as unsigned long in all supported architectures,
but gcc doesn't know that.

Fixes: c2fceabca6d5 ("drm/msm: Support multiple ringbuffers")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Rob Clark <robdclark@gmail.com>
  • Loading branch information
Arnd Bergmann authored and Rob Clark committed Nov 1, 2017
1 parent 18075d0 commit 39ae0d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/msm/msm_gpu.c
Original file line number Diff line number Diff line change
@@ -777,7 +777,7 @@ int msm_gpu_init(struct drm_device *drm, struct platform_device *pdev,
}

if (nr_rings > ARRAY_SIZE(gpu->rb)) {
DRM_DEV_INFO_ONCE(drm->dev, "Only creating %lu ringbuffers\n",
DRM_DEV_INFO_ONCE(drm->dev, "Only creating %zu ringbuffers\n",
ARRAY_SIZE(gpu->rb));
nr_rings = ARRAY_SIZE(gpu->rb);
}

0 comments on commit 39ae0d3

Please sign in to comment.