From: Hemant Agrawal <hemant.agrawal@nxp.com>
To: Gowrishankar <gowrishankar.m@linux.vnet.ibm.com>,
Hemant Agrawal <hemant.agrawal@nxp.com>,
Shreyansh Jain <shreyansh.jain@nxp.com>
Cc: Anatoly Burakov <anatoly.burakov@intel.com>,
dev@dpdk.org, Thomas Monjalon <thomas@monjalon.net>
Subject: Re: [dpdk-dev] [PATCH] bus/fslmc: use PRIu64 instead of llX in format specifier
Date: Fri, 13 Apr 2018 13:07:40 +0530 [thread overview]
Message-ID: <7f634248-2ec5-6c60-0015-a65888b41d01@nxp.com> (raw)
In-Reply-To: <5438d3242ebb9d995d0a52a63feba80efd783e6f.1523595487.git.gowrishankar.m@linux.vnet.ibm.com>
Hi Gowrishankar,
On 4/13/2018 10:34 AM, Gowrishankar wrote:
> From: Gowrishankar Muthukrishnan <gowrishankar.m@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 <gowrishankar.m@linux.vnet.ibm.com>
> --
> 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,
>
next prev parent reply other threads:[~2018-04-13 7:37 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-13 5:04 Gowrishankar
2018-04-13 7:10 ` Shreyansh Jain
2018-04-13 7:09 ` Hemant Agrawal
2018-04-13 7:37 ` Hemant Agrawal [this message]
2018-04-13 7:41 ` Thomas Monjalon
2018-04-13 8:56 ` Shreyansh Jain
2018-04-13 8:43 ` gowrishankar muthukrishnan
2018-04-13 10:37 ` Shreyansh Jain
2018-04-13 10:40 ` [dpdk-dev] [PATCH v2] " Gowrishankar
2018-04-13 10:47 ` gowrishankar muthukrishnan
2018-04-13 10:55 ` Gowrishankar
2018-04-13 11:17 ` Shreyansh Jain
2018-04-13 11:22 ` [dpdk-dev] [PATCH v3] " Gowrishankar
2018-04-13 12:44 ` Hemant Agrawal
2018-04-15 12:22 ` Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7f634248-2ec5-6c60-0015-a65888b41d01@nxp.com \
--to=hemant.agrawal@nxp.com \
--cc=anatoly.burakov@intel.com \
--cc=dev@dpdk.org \
--cc=gowrishankar.m@linux.vnet.ibm.com \
--cc=shreyansh.jain@nxp.com \
--cc=thomas@monjalon.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).