Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1670269 > unrolled thread
| Started by | Arvind Yadav <arvind.yadav.cs@gmail.com> |
|---|---|
| First post | 2017-06-20 07:00 +0200 |
| Last post | 2017-06-20 13:30 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] drm: sti: sti_hqvdp: Fix compilation warning. Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-06-20 07:00 +0200
Re: [PATCH] drm: sti: sti_hqvdp: Fix compilation warning. Benjamin Gaignard <benjamin.gaignard@linaro.org> - 2017-06-20 13:30 +0200
| From | Arvind Yadav <arvind.yadav.cs@gmail.com> |
|---|---|
| Date | 2017-06-20 07:00 +0200 |
| Subject | [PATCH] drm: sti: sti_hqvdp: Fix compilation warning. |
| Message-ID | <tUjqG-3YW-7@gated-at.bofh.it> |
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=]
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
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
[toc] | [next] | [standalone]
| From | Benjamin Gaignard <benjamin.gaignard@linaro.org> |
|---|---|
| Date | 2017-06-20 13:30 +0200 |
| Message-ID | <tUpw6-7XX-13@gated-at.bofh.it> |
| In reply to | #1670269 |
2017-06-20 6:55 GMT+02:00 Arvind Yadav <arvind.yadav.cs@gmail.com>:
> 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=]
I do not manage to reproduce the warnings on my side so I will merge
this patch yet.
Regards
Benjamin
>
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
> ---
> 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
>
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web