* [PATCH v2] v4l: sh_vou: Fix warnings due to improper casts and printk formats
@ 2013-11-27 10:15 Laurent Pinchart
2013-12-06 9:44 ` Laurent Pinchart
0 siblings, 1 reply; 2+ messages in thread
From: Laurent Pinchart @ 2013-11-27 10:15 UTC (permalink / raw)
To: linux-sh; +Cc: Guennadi Liakhovetski, Mauro Carvalho Chehab, linux-media
Use the %zu printk specifier to print size_t variables, and cast
pointers to uintptr_t instead of unsigned int where applicable. This
fixes warnings on platforms where pointers and/or dma_addr_t have a
different size than int.
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: Mauro Carvalho Chehab <m.chehab@samsung.com>
Cc: linux-media@vger.kernel.org
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
drivers/media/platform/sh_vou.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
Changes compared to v1:
- Cast to uintptr_t instead of unsigned long
diff --git a/drivers/media/platform/sh_vou.c b/drivers/media/platform/sh_vou.c
index 4f30341..69e2125 100644
--- a/drivers/media/platform/sh_vou.c
+++ b/drivers/media/platform/sh_vou.c
@@ -286,7 +286,7 @@ static int sh_vou_buf_prepare(struct videobuf_queue *vq,
vb->size = vb->height * bytes_per_line;
if (vb->baddr && vb->bsize < vb->size) {
/* User buffer too small */
- dev_warn(vq->dev, "User buffer too small: [%u] @ %lx\n",
+ dev_warn(vq->dev, "User buffer too small: [%zu] @ %lx\n",
vb->bsize, vb->baddr);
return -EINVAL;
}
@@ -302,9 +302,9 @@ static int sh_vou_buf_prepare(struct videobuf_queue *vq,
}
dev_dbg(vou_dev->v4l2_dev.dev,
- "%s(): fmt #%d, %u bytes per line, phys 0x%x, type %d, state %d\n",
+ "%s(): fmt #%d, %u bytes per line, phys 0x%lx, type %d, state %d\n",
__func__, vou_dev->pix_idx, bytes_per_line,
- videobuf_to_dma_contig(vb), vb->memory, vb->state);
+ (uintptr_t)videobuf_to_dma_contig(vb), vb->memory, vb->state);
return 0;
}
--
1.8.3.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] v4l: sh_vou: Fix warnings due to improper casts and printk formats
2013-11-27 10:15 [PATCH v2] v4l: sh_vou: Fix warnings due to improper casts and printk formats Laurent Pinchart
@ 2013-12-06 9:44 ` Laurent Pinchart
0 siblings, 0 replies; 2+ messages in thread
From: Laurent Pinchart @ 2013-12-06 9:44 UTC (permalink / raw)
To: Laurent Pinchart
Cc: linux-sh, Guennadi Liakhovetski, Mauro Carvalho Chehab,
linux-media
On Wednesday 27 November 2013 11:15:27 Laurent Pinchart wrote:
> Use the %zu printk specifier to print size_t variables, and cast
> pointers to uintptr_t instead of unsigned int where applicable. This
> fixes warnings on platforms where pointers and/or dma_addr_t have a
> different size than int.
Let's drop this, I'll resend a patch based on the new %pad printk modifier to
print dma_addr_t.
> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> Cc: Mauro Carvalho Chehab <m.chehab@samsung.com>
> Cc: linux-media@vger.kernel.org
> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> ---
> drivers/media/platform/sh_vou.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> Changes compared to v1:
>
> - Cast to uintptr_t instead of unsigned long
>
> diff --git a/drivers/media/platform/sh_vou.c
> b/drivers/media/platform/sh_vou.c index 4f30341..69e2125 100644
> --- a/drivers/media/platform/sh_vou.c
> +++ b/drivers/media/platform/sh_vou.c
> @@ -286,7 +286,7 @@ static int sh_vou_buf_prepare(struct videobuf_queue *vq,
> vb->size = vb->height * bytes_per_line;
> if (vb->baddr && vb->bsize < vb->size) {
> /* User buffer too small */
> - dev_warn(vq->dev, "User buffer too small: [%u] @ %lx\n",
> + dev_warn(vq->dev, "User buffer too small: [%zu] @ %lx\n",
> vb->bsize, vb->baddr);
> return -EINVAL;
> }
> @@ -302,9 +302,9 @@ static int sh_vou_buf_prepare(struct videobuf_queue *vq,
> }
>
> dev_dbg(vou_dev->v4l2_dev.dev,
> - "%s(): fmt #%d, %u bytes per line, phys 0x%x, type %d, state %d\n",
> + "%s(): fmt #%d, %u bytes per line, phys 0x%lx, type %d, state %d\n",
> __func__, vou_dev->pix_idx, bytes_per_line,
> - videobuf_to_dma_contig(vb), vb->memory, vb->state);
> + (uintptr_t)videobuf_to_dma_contig(vb), vb->memory, vb->state);
>
> return 0;
> }
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-12-06 9:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-27 10:15 [PATCH v2] v4l: sh_vou: Fix warnings due to improper casts and printk formats Laurent Pinchart
2013-12-06 9:44 ` Laurent Pinchart
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).