diff mbox series

[2/7] drm/sti: Use correct printk format specifiers for size_t

Message ID 20210728153736.15240-3-laurent.pinchart+renesas@ideasonboard.com (mailing list archive)
State Superseded
Delegated to: Kieran Bingham
Headers show
Series drm: Extend COMPILE_TEST support to some ARM drivers | expand

Commit Message

Laurent Pinchart July 28, 2021, 3:37 p.m. UTC
The correct format specifier for size_t is %zu. Using %d (or %u)
generates a warning on 64-bit platforms. Fix it.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
 drivers/gpu/drm/sti/sti_hqvdp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Philippe CORNU July 30, 2021, 9:35 a.m. UTC | #1
On 7/28/21 5:37 PM, Laurent Pinchart wrote:
> The correct format specifier for size_t is %zu. Using %d (or %u)
> generates a warning on 64-bit platforms. Fix it.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.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 d09b08995b12..3c61ba8b43e0 100644
> --- a/drivers/gpu/drm/sti/sti_hqvdp.c
> +++ b/drivers/gpu/drm/sti/sti_hqvdp.c
> @@ -927,12 +927,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 (%zu+%d+%d+%d+%d != %zu)\n",

Hi Laurent,

Looping Benjamin (new email address) and Alain (future maintainer of 
drm/sti).

Reviewed-by: Philippe Cornu <philippe.cornu@foss.st.com>
Many thanks for your patch,
Philippe :-)

>   			  sizeof(*header), header->rd_size, header->wr_size,
>   			  header->pmem_size, header->dmem_size,
>   			  firmware->size);
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/sti/sti_hqvdp.c b/drivers/gpu/drm/sti/sti_hqvdp.c
index d09b08995b12..3c61ba8b43e0 100644
--- a/drivers/gpu/drm/sti/sti_hqvdp.c
+++ b/drivers/gpu/drm/sti/sti_hqvdp.c
@@ -927,12 +927,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 (%zu+%d+%d+%d+%d != %zu)\n",
 			  sizeof(*header), header->rd_size, header->wr_size,
 			  header->pmem_size, header->dmem_size,
 			  firmware->size);