From: David Marchand Date: Fri, 28 Feb 2014 08:21:35 +0000 (+0100) Subject: mem: fix build of virtual address hinting for 32-bit X-Git-Tag: spdx-start~10918 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=4b28dda3dc83c249ae8ef66b9d59e2abcc923d3f;p=dpdk.git mem: fix build of virtual address hinting for 32-bit The initial commit doesn't build for 32-bit: 8ea9ff83 (mem: allow virtual memory address hinting) lib/librte_eal/linuxapp/eal/eal.c: In function ‘eal_parse_base_virtaddr’: build/include/rte_common.h:133:22: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] RTE_PTR_ALIGN_FLOOR((typeof(ptr))RTE_PTR_ADD(ptr, (align) - 1), align) ^ RTE_PTR_ALIGN_CEIL return type is the same as what we give it as input. So instead of casting the returned value, cast 'addr' which should be the same as base_virtaddr. Reported-by: Mats Liljegren Signed-off-by: David Marchand Acked-by: Thomas Monjalon --- diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c index db0e15cf98..72b4dd7b13 100644 --- a/lib/librte_eal/linuxapp/eal/eal.c +++ b/lib/librte_eal/linuxapp/eal/eal.c @@ -563,9 +563,9 @@ eal_parse_base_virtaddr(const char *arg) #endif /* align the addr on 2M boundary */ - addr = RTE_PTR_ALIGN_CEIL(addr, RTE_PGSIZE_2M); + internal_config.base_virtaddr = RTE_PTR_ALIGN_CEIL((uintptr_t)addr, + RTE_PGSIZE_2M); - internal_config.base_virtaddr = (uintptr_t) addr; return 0; }