From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hemant Agrawal Subject: Re: [PATCH] bus/fslmc: use PRIu64 instead of llX in format specifier Date: Fri, 13 Apr 2018 13:07:40 +0530 Message-ID: <7f634248-2ec5-6c60-0015-a65888b41d01@nxp.com> References: <5438d3242ebb9d995d0a52a63feba80efd783e6f.1523595487.git.gowrishankar.m@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Cc: Anatoly Burakov , dev@dpdk.org, Thomas Monjalon To: Gowrishankar , Hemant Agrawal , Shreyansh Jain Return-path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0075.outbound.protection.outlook.com [104.47.1.75]) by dpdk.org (Postfix) with ESMTP id 4F8541BB1B for ; Fri, 13 Apr 2018 09:37:55 +0200 (CEST) In-Reply-To: <5438d3242ebb9d995d0a52a63feba80efd783e6f.1523595487.git.gowrishankar.m@linux.vnet.ibm.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Gowrishankar, On 4/13/2018 10:34 AM, Gowrishankar wrote: > From: Gowrishankar Muthukrishnan > > 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 > -- > 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=] So, powerpc64LE is taking __u64 as long unsigned int, while x86_64 compiler is taking it as long long unsigned it. > 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 | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c > index 4036e82..a003a7d 100644 > --- a/drivers/bus/fslmc/fslmc_vfio.c > +++ b/drivers/bus/fslmc/fslmc_vfio.c > @@ -270,7 +270,7 @@ static int vfio_map_irq_region(struct fslmc_vfio_group *group) > return -1; > } > > - DPAA2_BUS_DEBUG("--> Map address: %llX, size: 0x%llX", > + DPAA2_BUS_DEBUG("--> Map address: %"PRIu64", size: 0x%"PRIu64"", > dma_map.vaddr, dma_map.size); You should also type cast the variables to avoid compilation issue on x86. - dma_map.vaddr, dma_map.size); + (uint64_t)dma_map.vaddr, uint64_t)dma_map.size); The same change is to be done at other two places as well in your patch. Please check compilation for x86_64 and i686, the patchwork compilation check is running late. > ret = ioctl(group->container->fd, VFIO_IOMMU_MAP_DMA, &dma_map); > if (ret) { > @@ -303,7 +303,7 @@ static int vfio_map_irq_region(struct fslmc_vfio_group *group) > return -1; > } > > - DPAA2_BUS_DEBUG("--> Unmap address: %llX, size: 0x%llX", > + DPAA2_BUS_DEBUG("--> Unmap address: %"PRIu64", size: 0x%"PRIu64"", > dma_unmap.iova, dma_unmap.size); > ret = ioctl(group->container->fd, VFIO_IOMMU_UNMAP_DMA, &dma_unmap); > if (ret) { > @@ -401,7 +401,7 @@ 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", > + DPAA2_BUS_DEBUG("Region offset = %"PRIu64" , region size = %"PRIu64"", > reg_info.offset, reg_info.size); > > v_addr = (size_t)mmap(NULL, reg_info.size, >