From: Santosh Shukla Date: Fri, 20 Oct 2017 12:31:36 +0000 (+0530) Subject: malloc: use pointer diff macro in IOVA mapping X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=b51c140a1e97a12c31aeb061276577440a5e9da5;p=dpdk.git malloc: use pointer diff macro in IOVA mapping Use RTE_PTR_DIFF macro in rte_mem_virt2iova api. Suggested-by: Anatoly Burakov Signed-off-by: Santosh Shukla --- diff --git a/lib/librte_eal/common/rte_malloc.c b/lib/librte_eal/common/rte_malloc.c index 53057fcba9..fe2278bcd7 100644 --- a/lib/librte_eal/common/rte_malloc.c +++ b/lib/librte_eal/common/rte_malloc.c @@ -262,6 +262,6 @@ rte_malloc_virt2iova(const void *addr) iova = (uintptr_t)addr; else iova = elem->ms->iova + - ((uintptr_t)addr - (uintptr_t)elem->ms->addr); + RTE_PTR_DIFF(addr, elem->ms->addr); return iova; }