malloc: use pointer diff macro in IOVA mapping

Use RTE_PTR_DIFF macro in rte_mem_virt2iova api.

Suggested-by: Anatoly Burakov <anatoly.burakov@intel.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
This commit is contained in:
Santosh Shukla 2017-10-20 18:01:36 +05:30 committed by Thomas Monjalon
parent 87cf4c6cca
commit b51c140a1e

View File

@ -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;
}