mem: fix build of virtual address hinting for 32-bit
authorDavid Marchand <david.marchand@6wind.com>
Fri, 28 Feb 2014 08:21:35 +0000 (09:21 +0100)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Thu, 20 Mar 2014 14:34:46 +0000 (15:34 +0100)
commit4b28dda3dc83c249ae8ef66b9d59e2abcc923d3f
tree9f2ab0fe3a42672dfc70215db7d8933846eb48cc
parent2a315d698510e7b33a7c9516ef532dbcd44c027f
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 <mats.liljegren@enea.com>
Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
lib/librte_eal/linuxapp/eal/eal.c