From 8a70b112e6f019b8b2998767d536f797d935e2f8 Mon Sep 17 00:00:00 2001 From: Bruce Richardson Date: Tue, 3 Jul 2018 11:31:18 +0100 Subject: [PATCH] net/avp: fix 32-bit meson builds When compiling with meson, extra warnings are enabled about casting from integers to different size pointers. This triggers an error in AVP as the addition of the offset to the pointer address causes the result to be a 64-bit integer which doesn't fit a 32-bit pointer. The fix here is to explicitly indicate that the offset is of type "uintptr_t" which prevents any promotion which would cause errors. Fixes: c0ad584222b5 ("net/avp: add device initialization") Signed-off-by: Bruce Richardson Acked-by: Allain Legacy Acked-by: Hemant Agrawal --- drivers/net/avp/avp_ethdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/avp/avp_ethdev.c b/drivers/net/avp/avp_ethdev.c index 7b4d89d32e..761f6c1c4f 100644 --- a/drivers/net/avp/avp_ethdev.c +++ b/drivers/net/avp/avp_ethdev.c @@ -383,7 +383,7 @@ avp_dev_translate_address(struct rte_eth_dev *eth_dev, (host_phys_addr < (map->phys_addr + map->length))) { /* address is within this segment */ offset += (host_phys_addr - map->phys_addr); - addr = RTE_PTR_ADD(addr, offset); + addr = RTE_PTR_ADD(addr, (uintptr_t)offset); PMD_DRV_LOG(DEBUG, "Translating host physical 0x%" PRIx64 " to guest virtual 0x%p\n", host_phys_addr, addr); -- 2.20.1