On Friday 13 April 2018 04:25 PM, Gowrishankar wrote:
From: Gowrishankar Muthukrishnan <gowrishanka...@linux.vnet.ibm.com>
Instead of llX, use C99 standard "PRIu64" in format specifier. Former one
breaks compile in ppc64le.
Fixes: c2c167fdb3 ("bus/fslmc: support memory event callbacks for VFIO")
Signed-off-by: Gowrishankar Muthukrishnan <gowrishanka...@linux.vnet.ibm.com>
--
v2:
- corrected format specifier wrt address and size.
Thanks Shreyansh, Hemant and Thomas.
In file included from dpdk/drivers/bus/fslmc/fslmc_vfio.c:37:0:
dpdk/drivers/bus/fslmc/fslmc_vfio.c: In function ‘fslmc_map_dma’:
dpdk/drivers/bus/fslmc/fslmc_logs.h:18:44: error: format ‘%llX’ expects
argument of type ‘long long unsigned int’, but argument 5 has type ‘__u64 {aka
long unsigned int}’ [-Werror=format=]
rte_log(RTE_LOG_DEBUG, dpaa2_logtype_bus, "fslmc: %s(): " fmt "\n", \
^
dpdk/drivers/bus/fslmc/fslmc_vfio.c:272:2: note: in expansion of macro
‘DPAA2_BUS_DEBUG’
DPAA2_BUS_DEBUG("--> Map address: %llX, size: 0x%llX",
^~~~~~~~~~~~~~~
dpdk/drivers/bus/fslmc/fslmc_vfio.c:272:39: note: format string is defined here
DPAA2_BUS_DEBUG("--> Map address: %llX, size: 0x%llX",
~~~^
%lX
---
drivers/bus/fslmc/fslmc_vfio.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c
index 4036e82..93c20f3 100644
--- a/drivers/bus/fslmc/fslmc_vfio.c
+++ b/drivers/bus/fslmc/fslmc_vfio.c
@@ -270,8 +270,8 @@ static int vfio_map_irq_region(struct fslmc_vfio_group
*group)
return -1;
}
- DPAA2_BUS_DEBUG("--> Map address: %llX, size: 0x%llX",
- dma_map.vaddr, dma_map.size);
+ DPAA2_BUS_DEBUG("--> Map address: %"PRIx64", size: 0x%"PRIu64"",
^^^^^^^^^^^^^^^^^^^^^^
Should be: 0x%"PRIx64", size: %"PRIu64""
+ (uint64_t)dma_map.vaddr, (uint64_t)dma_map.size);
ret = ioctl(group->container->fd, VFIO_IOMMU_MAP_DMA, &dma_map);
if (ret) {
DPAA2_BUS_ERR("VFIO_IOMMU_MAP_DMA API(errno = %d)",
@@ -303,8 +303,8 @@ static int vfio_map_irq_region(struct fslmc_vfio_group
*group)
return -1;
}
- DPAA2_BUS_DEBUG("--> Unmap address: %llX, size: 0x%llX",
- dma_unmap.iova, dma_unmap.size);
+ DPAA2_BUS_DEBUG("--> Unmap address: %"PRIx64", size: 0x%"PRIu64"",
^^^^^^^^^^^^^^^^^^^^^^
Should be: 0x%"PRIx64", size: %"PRIu64""
+ (uint64_t)dma_unmap.iova, (uint64_t)dma_unmap.size);
ret = ioctl(group->container->fd, VFIO_IOMMU_UNMAP_DMA, &dma_unmap);
if (ret) {
DPAA2_BUS_ERR("VFIO_IOMMU_UNMAP_DMA API(errno = %d)",
@@ -401,8 +401,8 @@ static int64_t vfio_map_mcp_obj(struct fslmc_vfio_group
*group, char *mcp_obj)
goto MC_FAILURE;
}
- DPAA2_BUS_DEBUG("Region offset = %llx , region size = %llx",
- reg_info.offset, reg_info.size);
+ DPAA2_BUS_DEBUG("Region offset = %"PRIx64" , region size = %"PRIu64"",
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Should be: 0x%"PRIx64", region size = %"PRIu64""
+ (uint64_t)reg_info.offset, (uint64_t)reg_info.size);
v_addr = (size_t)mmap(NULL, reg_info.size,
PROT_WRITE | PROT_READ, MAP_SHARED,