<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hi,<br>
</p>
<br>
<div class="moz-cite-prefix">On Tuesday 20 June 2017 04:59 PM,
Benjamin Gaignard wrote:<br>
</div>
<blockquote
cite="mid:CA+M3ks6NvoDsqtnaJc3bDqQU3y8qP2No5P727GfgO-aqrWgNxg@mail.gmail.com"
type="cite">
<pre wrap="">2017-06-20 6:55 GMT+02:00 Arvind Yadav <a class="moz-txt-link-rfc2396E" href="mailto:arvind.yadav.cs@gmail.com"><arvind.yadav.cs@gmail.com></a>:
</pre>
<blockquote type="cite">
<pre wrap="">Replace '%d' by '%zu' and '%lu' to fix the following compilation warning:-
drivers/gpu/drm/sti/sti_hqvdp.c: In function ‘sti_hqvdp_start_xp70’:
drivers/gpu/drm/sti/sti_hqvdp.c:925:3: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘size_t’ [-Wformat=]
DRM_ERROR("Invalid firmware size (%d)\n", firmware->size);
^
drivers/gpu/drm/sti/sti_hqvdp.c:930:3: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘long unsigned int’ [-Wformat=]
DRM_ERROR("Invalid fmw structure (%d+%d+%d+%d+%d != %d)\n",
^
drivers/gpu/drm/sti/sti_hqvdp.c:930:3: warning: format ‘%d’ expects argument of type ‘int’, but argument 9 has type ‘size_t’ [-Wformat=]
</pre>
</blockquote>
<pre wrap="">
I do not manage to reproduce the warnings on my side so I will merge
this patch yet.</pre>
</blockquote>
Please look
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<a href="http://androidxref.com/kernel_3.18/xref/include/"
style="text-decoration: none; color: rgb(32, 32, 98); font-family:
monospace; font-size: medium; font-style: normal;
font-variant-ligatures: normal; font-variant-caps: normal;
font-weight: normal; letter-spacing: normal; orphans: 2;
text-align: start; text-indent: 0px; text-transform: none;
white-space: normal; widows: 2; word-spacing: 0px;
-webkit-text-stroke-width: 0px; background-color: rgb(255, 255,
255);">include</a><span style="color: rgb(0, 0, 0); font-family:
monospace; font-size: medium; font-style: normal;
font-variant-ligatures: normal; font-variant-caps: normal;
font-weight: normal; letter-spacing: normal; orphans: 2;
text-align: start; text-indent: 0px; text-transform: none;
white-space: normal; widows: 2; word-spacing: 0px;
-webkit-text-stroke-width: 0px; background-color: rgb(255, 255,
255); display: inline !important; float: none;">/</span><a
href="http://androidxref.com/kernel_3.18/xref/include/linux/"
style="text-decoration: none; color: rgb(32, 32, 98); font-family:
monospace; font-size: medium; font-style: normal;
font-variant-ligatures: normal; font-variant-caps: normal;
font-weight: normal; letter-spacing: normal; orphans: 2;
text-align: start; text-indent: 0px; text-transform: none;
white-space: normal; widows: 2; word-spacing: 0px;
-webkit-text-stroke-width: 0px; background-color: rgb(255, 255,
255);">linux</a><span style="color: rgb(0, 0, 0); font-family:
monospace; font-size: medium; font-style: normal;
font-variant-ligatures: normal; font-variant-caps: normal;
font-weight: normal; letter-spacing: normal; orphans: 2;
text-align: start; text-indent: 0px; text-transform: none;
white-space: normal; widows: 2; word-spacing: 0px;
-webkit-text-stroke-width: 0px; background-color: rgb(255, 255,
255); display: inline !important; float: none;">/</span><a
href="http://androidxref.com/kernel_3.18/xref/include/linux/firmware.h"
style="text-decoration: none; color: rgb(32, 32, 98); font-family:
monospace; font-size: medium; font-style: normal;
font-variant-ligatures: normal; font-variant-caps: normal;
font-weight: normal; letter-spacing: normal; orphans: 2;
text-align: start; text-indent: 0px; text-transform: none;
white-space: normal; widows: 2; word-spacing: 0px;
-webkit-text-stroke-width: 0px; background-color: rgb(255, 255,
255);">firmware.h</a> file. You can find declaration of struct
firmware { size_t size; ...}<br>
type of 'size' variable is size_t. so it should be '%zu'. <br>
<br>
<blockquote
cite="mid:CA+M3ks6NvoDsqtnaJc3bDqQU3y8qP2No5P727GfgO-aqrWgNxg@mail.gmail.com"
type="cite">
<pre wrap="">
Regards
Benjamin
</pre>
<blockquote type="cite">
<pre wrap="">
Signed-off-by: Arvind Yadav <a class="moz-txt-link-rfc2396E" href="mailto:arvind.yadav.cs@gmail.com"><arvind.yadav.cs@gmail.com></a>
---
drivers/gpu/drm/sti/sti_hqvdp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/sti/sti_hqvdp.c b/drivers/gpu/drm/sti/sti_hqvdp.c
index 66f8431..267d816 100644
--- a/drivers/gpu/drm/sti/sti_hqvdp.c
+++ b/drivers/gpu/drm/sti/sti_hqvdp.c
@@ -922,12 +922,12 @@ static void sti_hqvdp_start_xp70(struct sti_hqvdp *hqvdp)
header = (struct fw_header *)firmware->data;
if (firmware->size < sizeof(*header)) {
- DRM_ERROR("Invalid firmware size (%d)\n", firmware->size);
+ DRM_ERROR("Invalid firmware size (%zu)\n", firmware->size);
goto out;
}
if ((sizeof(*header) + header->rd_size + header->wr_size +
header->pmem_size + header->dmem_size) != firmware->size) {
- DRM_ERROR("Invalid fmw structure (%d+%d+%d+%d+%d != %d)\n",
+ DRM_ERROR("Invalid fmw structure (%lu+%d+%d+%d+%d != %zu)\n",
sizeof(*header), header->rd_size, header->wr_size,
header->pmem_size, header->dmem_size,
firmware->size);
--
1.9.1
</pre>
</blockquote>
</blockquote>
<br>
</body>
</html>