Skip to content

Commit

Permalink
drm/qxl: Remove format string errors
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Frediano Ziglio authored and Dave Airlie committed Jun 5, 2015
1 parent de0b523 commit 72ec565
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/qxl/qxl_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ int qxl_garbage_collect(struct qxl_device *qdev)
}
}

QXL_INFO(qdev, "%s: %lld\n", __func__, i);
QXL_INFO(qdev, "%s: %d\n", __func__, i);

return i;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/qxl/qxl_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ static int qxl_display_copy_rom_client_monitors_config(struct qxl_device *qdev)
crc = crc32(0, (const uint8_t *)&qdev->rom->client_monitors_config,
sizeof(qdev->rom->client_monitors_config));
if (crc != qdev->rom->client_monitors_config_crc) {
qxl_io_log(qdev, "crc mismatch: have %X (%d) != %X\n", crc,
qxl_io_log(qdev, "crc mismatch: have %X (%zd) != %X\n", crc,
sizeof(qdev->rom->client_monitors_config),
qdev->rom->client_monitors_config_crc);
return 1;
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/qxl/qxl_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ struct qxl_device {
};

/* forward declaration for QXL_INFO_IO */
void qxl_io_log(struct qxl_device *qdev, const char *fmt, ...);
__printf(2,3) void qxl_io_log(struct qxl_device *qdev, const char *fmt, ...);

extern const struct drm_ioctl_desc qxl_ioctls[];
extern int qxl_max_ioctl;
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/qxl/qxl_release.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ qxl_release_alloc(struct qxl_device *qdev, int type,
return handle;
}
*ret = release;
QXL_INFO(qdev, "allocated release %lld\n", handle);
QXL_INFO(qdev, "allocated release %d\n", handle);
release->id = handle;
return handle;
}
Expand Down

0 comments on commit 72ec565

Please sign in to comment.