* [PATCH] rpmsg: fix build warning when compiling 64-bit
@ 2012-02-29 14:50 Mark Asselstine
2012-02-29 14:55 ` Arnd Bergmann
0 siblings, 1 reply; 4+ messages in thread
From: Mark Asselstine @ 2012-02-29 14:50 UTC (permalink / raw)
To: linux-arm-kernel
dev_dbg() in rpmsg_probe() made use of the %x formatting
which expects an 'unsigned int' which dma_addr_t is not
when compiling for 64-bit. Casting to a 'void *' and
using %p will avoid this and not force an upcast to a
64-bit value for 32-bit builds.
Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
CC: Ohad Ben-Cohen <ohad@wizery.com>
---
drivers/rpmsg/virtio_rpmsg_bus.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/rpmsg/virtio_rpmsg_bus.c b/drivers/rpmsg/virtio_rpmsg_bus.c
index 8980ac2..28558f6 100644
--- a/drivers/rpmsg/virtio_rpmsg_bus.c
+++ b/drivers/rpmsg/virtio_rpmsg_bus.c
@@ -891,8 +891,8 @@ static int rpmsg_probe(struct virtio_device *vdev)
if (!bufs_va)
goto vqs_del;
- dev_dbg(&vdev->dev, "buffers: va %p, dma 0x%x\n", bufs_va,
- vrp->bufs_dma);
+ dev_dbg(&vdev->dev, "buffers: va %p, dma %p\n", bufs_va,
+ (void *)vrp->bufs_dma);
/* half of the buffers is dedicated for RX */
vrp->rbufs = bufs_va;
--
1.7.5.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] rpmsg: fix build warning when compiling 64-bit
2012-02-29 14:50 [PATCH] rpmsg: fix build warning when compiling 64-bit Mark Asselstine
@ 2012-02-29 14:55 ` Arnd Bergmann
2012-02-29 15:41 ` [PATCH V2] rpmsg: fix build warning when dma_addr_t is 64-bit Mark Asselstine
0 siblings, 1 reply; 4+ messages in thread
From: Arnd Bergmann @ 2012-02-29 14:55 UTC (permalink / raw)
To: linux-arm-kernel
On Wednesday 29 February 2012, Mark Asselstine wrote:
> dev_dbg() in rpmsg_probe() made use of the %x formatting
> which expects an 'unsigned int' which dma_addr_t is not
> when compiling for 64-bit. Casting to a 'void *' and
> using %p will avoid this and not force an upcast to a
> 64-bit value for 32-bit builds.
This does not work on 32-bit platforms with a 64-bit dma_addr_t
though. Better cast to unsigned long long and print using 0x%llx.
Arnd
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH V2] rpmsg: fix build warning when dma_addr_t is 64-bit
2012-02-29 14:55 ` Arnd Bergmann
@ 2012-02-29 15:41 ` Mark Asselstine
2012-03-04 11:47 ` Ohad Ben-Cohen
0 siblings, 1 reply; 4+ messages in thread
From: Mark Asselstine @ 2012-02-29 15:41 UTC (permalink / raw)
To: linux-arm-kernel
dev_dbg() in rpmsg_probe() made use of the %x formatting that
expects an 'unsigned int' which dma_addr_t is not in cases where
dma_addr_t is 64-bit (CONFIG_ARCH_DMA_ADDR_T_64BIT). Casting to
a 'unsigned long long' and using %llx will avoid this.
Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
CC: Ohad Ben-Cohen <ohad@wizery.com>
CC: Arnd Bergmann <arnd@arndb.de>
---
drivers/rpmsg/virtio_rpmsg_bus.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/rpmsg/virtio_rpmsg_bus.c b/drivers/rpmsg/virtio_rpmsg_bus.c
index 8980ac2..c142e7b 100644
--- a/drivers/rpmsg/virtio_rpmsg_bus.c
+++ b/drivers/rpmsg/virtio_rpmsg_bus.c
@@ -891,8 +891,8 @@ static int rpmsg_probe(struct virtio_device *vdev)
if (!bufs_va)
goto vqs_del;
- dev_dbg(&vdev->dev, "buffers: va %p, dma 0x%x\n", bufs_va,
- vrp->bufs_dma);
+ dev_dbg(&vdev->dev, "buffers: va %p, dma 0x%llx\n", bufs_va,
+ (unsigned long long)vrp->bufs_dma);
/* half of the buffers is dedicated for RX */
vrp->rbufs = bufs_va;
--
1.7.5.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH V2] rpmsg: fix build warning when dma_addr_t is 64-bit
2012-02-29 15:41 ` [PATCH V2] rpmsg: fix build warning when dma_addr_t is 64-bit Mark Asselstine
@ 2012-03-04 11:47 ` Ohad Ben-Cohen
0 siblings, 0 replies; 4+ messages in thread
From: Ohad Ben-Cohen @ 2012-03-04 11:47 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Feb 29, 2012 at 5:41 PM, Mark Asselstine
<mark.asselstine@windriver.com> wrote:
> dev_dbg() in rpmsg_probe() made use of the %x formatting that
> expects an 'unsigned int' which dma_addr_t is not in cases where
> dma_addr_t is 64-bit (CONFIG_ARCH_DMA_ADDR_T_64BIT). Casting to
> a 'unsigned long long' and using %llx will avoid this.
>
> Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
> CC: Ohad Ben-Cohen <ohad@wizery.com>
> CC: Arnd Bergmann <arnd@arndb.de>
Thanks, Mark !
I'll send this to Arnd later this week together with the other
remoteproc/rpmsg patches.
Ohad.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-03-04 11:47 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-29 14:50 [PATCH] rpmsg: fix build warning when compiling 64-bit Mark Asselstine
2012-02-29 14:55 ` Arnd Bergmann
2012-02-29 15:41 ` [PATCH V2] rpmsg: fix build warning when dma_addr_t is 64-bit Mark Asselstine
2012-03-04 11:47 ` Ohad Ben-Cohen
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).