From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id F06BD1B26B for ; Mon, 6 Nov 2017 02:42:15 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 8D74B205FC; Sun, 5 Nov 2017 20:42:15 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Sun, 05 Nov 2017 20:42:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=mesmtp; bh=eNCvNpSQyl+aCX xfNzzMzu2LenZt/+K5qS6CAWiJzas=; b=S95qNOr1gDk1gbtG0cV7IVFEfkO5w4 BCqVJUMu5eTwUeCtCR9HxQ58/NKRWjpKxDk9K0Cv6AUW77beAG+LIq6m1iwzojyl yTmM5INM1Xki1pTxHWDkJue53YzPQsgx1w6r/jAETBu4JesRYayXIxs8oaKskdiy WHcxENCY9I9Bw= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=eNCvNpSQyl+aCXxfNzzMzu2LenZt/+K5qS6CAWiJzas=; b=jTygCilk YoRS5Iowg8mZCV5l4gY1bDEgZ358MH/96dN3d04Uw9IYOJGR6MoQdZPNBI4YPPLL vMTdkue6S+XjlW1rrHBtUVZFus3H0pcpUIP1F0EofWEYLHXzhggYoN53cCjyVttj OqlTOatC8vCmPvsz3tHuKMtlAJqkzzo0xk7X0G4UG6a0COK4WL/Y5/R4hrdavIgi dY9dXjeo2PvEUZxcfhV7ehYICP2v119WDSfo1CY1qvLleG8UdroBDmBcfppn1lJh KwYQ28fiDE/IalYichHIY+kLIJQeCOjHVY97AS9HrnzuX7Xl+9XsPfVXganDZEBQ eXZd2kgh5xnrVw== X-ME-Sender: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id A0EC924DF9; Sun, 5 Nov 2017 20:42:14 -0500 (EST) From: Thomas Monjalon To: Santosh Shukla Cc: olivier.matz@6wind.com, sergio.gonzalez.monroy@intel.com, anatoly.burakov@intel.com, dev@dpdk.org Date: Mon, 6 Nov 2017 02:41:32 +0100 Message-Id: <20171106014141.13266-7-thomas@monjalon.net> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171106014141.13266-1-thomas@monjalon.net> References: <20170814151537.29454-1-santosh.shukla@caviumnetworks.com> <20171106014141.13266-1-thomas@monjalon.net> Subject: [dpdk-dev] [PATCH v4 06/15] malloc: use pointer diff macro in IOVA mapping X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Nov 2017 01:42:16 -0000 From: Santosh Shukla 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 53057fcba..fe2278bcd 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; } -- 2.14.2