From mboxrd@z Thu Jan 1 00:00:00 1970 From: Santosh Shukla Subject: [PATCH v3 6/6] eal/common/rte_malloc: use pointer diff in virt2iova Date: Fri, 20 Oct 2017 18:01:36 +0530 Message-ID: <20171020123136.10557-7-santosh.shukla@caviumnetworks.com> References: <20170905103119.20511-1-santosh.shukla@caviumnetworks.com> <20171020123136.10557-1-santosh.shukla@caviumnetworks.com> Mime-Version: 1.0 Content-Type: text/plain Cc: olivier.matz@6wind.com, thomas@monjalon.net, jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com, anatoly.burakov@intel.com, Santosh Shukla To: dev@dpdk.org Return-path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0075.outbound.protection.outlook.com [104.47.42.75]) by dpdk.org (Postfix) with ESMTP id AC73A1B263 for ; Fri, 20 Oct 2017 14:32:35 +0200 (CEST) In-Reply-To: <20171020123136.10557-1-santosh.shukla@caviumnetworks.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Use RTE_PTR_DIFF macro in rte_mem_virt2iova api. Suggested-by: Anatoly Burakov Signed-off-by: Santosh Shukla --- lib/librte_eal/common/rte_malloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_eal/common/rte_malloc.c b/lib/librte_eal/common/rte_malloc.c index f8473832a..aa3bd5687 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) paddr = (uintptr_t)addr; else paddr = elem->ms->iova_addr + - ((uintptr_t)addr - (uintptr_t)elem->ms->addr); + RTE_PTR_DIFF(addr, elem->ms->addr); return paddr; } -- 2.14.1