Skip to content

Commit 6f27e4c

Browse files
committed
drm/vblank: Fix -Wformat compile warnings on some arches
On some architectures like ppc64le and aarch64, compiling with -Wformat=1 will throw the following warnings: In file included from drivers/gpu/drm/drm_vblank.c:33: drivers/gpu/drm/drm_vblank.c: In function 'drm_update_vblank_count': drivers/gpu/drm/drm_vblank.c:273:16: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'long int' [-Wformat=] DRM_DEBUG_VBL("updating vblank count on crtc %u:" ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./include/drm/drm_print.h:407:22: note: in definition of macro 'DRM_DEBUG_VBL' drm_dbg(DRM_UT_VBL, fmt, ##__VA_ARGS__) ^~~ drivers/gpu/drm/drm_vblank.c:274:22: note: format string is defined here " current=%llu, diff=%u, hw=%u hw_last=%u\n", ~~~^ %lu So, fix that with a typecast. Co-developed-by: Dave Airlie <[email protected]> Signed-off-by: Lyude Paul <[email protected]> Reviewed-by: Thomas Zimmermann <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 0df3ff4 commit 6f27e4c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/gpu/drm/drm_vblank.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,8 @@ static void drm_update_vblank_count(struct drm_device *dev, unsigned int pipe,
278278

279279
DRM_DEBUG_VBL("updating vblank count on crtc %u:"
280280
" current=%llu, diff=%u, hw=%u hw_last=%u\n",
281-
pipe, atomic64_read(&vblank->count), diff,
282-
cur_vblank, vblank->last);
281+
pipe, (unsigned long long)atomic64_read(&vblank->count),
282+
diff, cur_vblank, vblank->last);
283283

284284
if (diff == 0) {
285285
WARN_ON_ONCE(cur_vblank != vblank->last);

0 commit comments

Comments
 (0)