From mboxrd@z Thu Jan 1 00:00:00 1970 From: Shreyansh Jain Subject: Re: [PATCH] bus/fslmc: use PRIu64 instead of llX in format specifier Date: Fri, 13 Apr 2018 16:07:11 +0530 Message-ID: <16f772e5-71f6-6116-3750-d6e7a6293249@nxp.com> References: <5438d3242ebb9d995d0a52a63feba80efd783e6f.1523595487.git.gowrishankar.m@linux.vnet.ibm.com> <4074558.oWdUdNoPZr@xps> <893c8705-858c-336d-c600-c4a23e8fea5b@nxp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Cc: dev@dpdk.org To: gowrishankar muthukrishnan Return-path: Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40067.outbound.protection.outlook.com [40.107.4.67]) by dpdk.org (Postfix) with ESMTP id 587201B668 for ; Fri, 13 Apr 2018 12:22:13 +0200 (CEST) In-Reply-To: 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" On Friday 13 April 2018 02:13 PM, gowrishankar muthukrishnan wrote: > On Friday 13 April 2018 02:26 PM, Shreyansh Jain wrote: >> On Friday 13 April 2018 01:11 PM, Thomas Monjalon wrote: >>> 13/04/2018 07:04, Gowrishankar: >>>> -    DPAA2_BUS_DEBUG("--> Map address: %llX, size: 0x%llX", >>>> +    DPAA2_BUS_DEBUG("--> Map address: %"PRIu64", size: 0x%"PRIu64"", >>> >>> You cannot replace hexadecimal by decimal. >>> You need to use PRIx64. >>> >>> >> >> Now that Thomas has pointed out, I think the log message can be >> improved. Len as hex is not helpful and is out of sync with other >> messages in this file. >> >> While on this, I think it should be corrected. >> I will fix this. >> >> @gowrishankar, I will post a patch in reply to your patch - can you >> please help me with ppc64le check? I will take care of Hemant's comment. > > Yup, I check for it. Thanks Shreyansh. > Can you please check this: --->8--- @@ -270,8 +270,8 @@ fslmc_map_dma(uint64_t vaddr, rte_iova_t iovaddr __rte_unused, size_t len) return -1; } - DPAA2_BUS_DEBUG("--> Map address: %llX, size: 0x%llX", - dma_map.vaddr, dma_map.size); + DPAA2_BUS_DEBUG("--> Map address: 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 @@ fslmc_unmap_dma(uint64_t vaddr, uint64_t iovaddr __rte_unused, size_t len) return -1; } - DPAA2_BUS_DEBUG("--> Unmap address: %llX, size: 0x%llX", - dma_unmap.iova, dma_unmap.size); + DPAA2_BUS_DEBUG("--> Unmap address: 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 = 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, --->8--- gcc for i686/x86_64/ARM64 are compiling fine for me. If this works fine, feel free to use it in your patch. - Shreyansh