Skip to contentSkip to conversation

rpmsg: fix build warning when compiling 64-bit

PATCH Superseded Mark Asselstine 3 participants 4 messages Feb 29, 2012 – Mar 4, 2012 Remote processor messaging (rpmsg)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rpmsg: fix build warning when compiling 64-bit

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.

---
 drivers/rpmsg/virtio_rpmsg_bus.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/rpmsg/virtio_rpmsg_bus.c +2 -2
index 8980ac2..28558f6 100644
@@ -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;
Signature · 1 line
1.7.5.4
#1 lore raw

PATCH 1/1 rpmsg: fix build warning when compiling 64-bit

Quoted 5 lines · Mark Asselstine

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

#2 lore raw

PATCH v2 1/1 rpmsg: fix build warning when dma_addr_t is 64-bit

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.

CC Ohad Ben-Cohen <[email protected]>
CC Arnd Bergmann <[email protected]>
---
 drivers/rpmsg/virtio_rpmsg_bus.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/rpmsg/virtio_rpmsg_bus.c +2 -2
index 8980ac2..c142e7b 100644
@@ -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;
Signature · 1 line
1.7.5.4
#3 lore raw

PATCH v2 1/1 rpmsg: fix build warning when dma_addr_t is 64-bit

Quoted 8 lines · Mark Asselstine

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.

CC Ohad Ben-Cohen <[email protected]>
CC Arnd Bergmann <[email protected]>

Thanks, Mark !

I'll send this to Arnd later this week together with the other remoteproc/rpmsg patches.

Ohad.