diff options
author | Noralf Trønnes <noralf@tronnes.org> | 2017-02-23 08:29:56 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2017-02-23 21:08:59 -0500 |
commit | ce8c0137001e3ac237830a6059addaee3b5e0e26 (patch) | |
tree | ae7b0fda65b018122d59d6c656c9b9551c87cc5c | |
parent | b401f34314db7c60e6d23ee7771cd090b4ef56c1 (diff) |
drm/tinydrm: mipi-dbi: Fix field width specifier warning
This warning is seen on 64-bit builds in functions:
'mipi_dbi_typec1_command':
'mipi_dbi_typec3_command_read':
'mipi_dbi_typec3_command':
>> drivers/gpu/drm/tinydrm/mipi-dbi.c:65:20: warning: field width specifier '*' expects argument of type 'int', but argument 5 has type 'size_t {aka long unsigned int}' [-Wformat=]
DRM_DEBUG_DRIVER("cmd=%02x, par=%*ph\n", cmd, len, data); \
^
include/drm/drmP.h:228:40: note: in definition of macro 'DRM_DEBUG_DRIVER'
drm_printk(KERN_DEBUG, DRM_UT_DRIVER, fmt, ##__VA_ARGS__)
^~~
>> drivers/gpu/drm/tinydrm/mipi-dbi.c:671:2: note: in expansion of macro 'MIPI_DBI_DEBUG_COMMAND'
MIPI_DBI_DEBUG_COMMAND(cmd, parameters, num);
^~~~~~~~~~~~~~~~~~~~~~
Fix by casting 'len' to int in the macro MIPI_DBI_DEBUG_COMMAND().
There is no chance of overflow.
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r-- | drivers/gpu/drm/tinydrm/mipi-dbi.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/tinydrm/mipi-dbi.c b/drivers/gpu/drm/tinydrm/mipi-dbi.c index 2caecdea7ab3..2d21b490005c 100644 --- a/drivers/gpu/drm/tinydrm/mipi-dbi.c +++ b/drivers/gpu/drm/tinydrm/mipi-dbi.c | |||
@@ -62,9 +62,9 @@ | |||
62 | if (!len) \ | 62 | if (!len) \ |
63 | DRM_DEBUG_DRIVER("cmd=%02x\n", cmd); \ | 63 | DRM_DEBUG_DRIVER("cmd=%02x\n", cmd); \ |
64 | else if (len <= 32) \ | 64 | else if (len <= 32) \ |
65 | DRM_DEBUG_DRIVER("cmd=%02x, par=%*ph\n", cmd, len, data); \ | 65 | DRM_DEBUG_DRIVER("cmd=%02x, par=%*ph\n", cmd, (int)len, data);\ |
66 | else \ | 66 | else \ |
67 | DRM_DEBUG_DRIVER("cmd=%02x, len=%zu\n", cmd, len); \ | 67 | DRM_DEBUG_DRIVER("cmd=%02x, len=%zu\n", cmd, (int)len); \ |
68 | }) | 68 | }) |
69 | 69 | ||
70 | static const u8 mipi_dbi_dcs_read_commands[] = { | 70 | static const u8 mipi_dbi_dcs_read_commands[] = { |