Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/qxl: Remove format string errors

Enable format string checks for qxl_io_log and remove resulting warnings
which could lead to memory errors on different platform or just printing
wrong information.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>

authored by

Frediano Ziglio and committed by
Dave Airlie
72ec5650 de0b523a

+4 -4
+1 -1
drivers/gpu/drm/qxl/qxl_cmd.c
··· 248 248 } 249 249 } 250 250 251 - QXL_INFO(qdev, "%s: %lld\n", __func__, i); 251 + QXL_INFO(qdev, "%s: %d\n", __func__, i); 252 252 253 253 return i; 254 254 }
+1 -1
drivers/gpu/drm/qxl/qxl_display.c
··· 67 67 crc = crc32(0, (const uint8_t *)&qdev->rom->client_monitors_config, 68 68 sizeof(qdev->rom->client_monitors_config)); 69 69 if (crc != qdev->rom->client_monitors_config_crc) { 70 - qxl_io_log(qdev, "crc mismatch: have %X (%d) != %X\n", crc, 70 + qxl_io_log(qdev, "crc mismatch: have %X (%zd) != %X\n", crc, 71 71 sizeof(qdev->rom->client_monitors_config), 72 72 qdev->rom->client_monitors_config_crc); 73 73 return 1;
+1 -1
drivers/gpu/drm/qxl/qxl_drv.h
··· 328 328 }; 329 329 330 330 /* forward declaration for QXL_INFO_IO */ 331 - void qxl_io_log(struct qxl_device *qdev, const char *fmt, ...); 331 + __printf(2,3) void qxl_io_log(struct qxl_device *qdev, const char *fmt, ...); 332 332 333 333 extern const struct drm_ioctl_desc qxl_ioctls[]; 334 334 extern int qxl_max_ioctl;
+1 -1
drivers/gpu/drm/qxl/qxl_release.c
··· 153 153 return handle; 154 154 } 155 155 *ret = release; 156 - QXL_INFO(qdev, "allocated release %lld\n", handle); 156 + QXL_INFO(qdev, "allocated release %d\n", handle); 157 157 release->id = handle; 158 158 return handle; 159 159 }