eal: fix type casting of value to align
authorJohn McNamara <john.mcnamara@intel.com>
Mon, 16 Mar 2015 17:05:06 +0000 (17:05 +0000)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Mon, 16 Mar 2015 23:46:01 +0000 (00:46 +0100)
commit66abc3f310a9eeb816ff37107c29f4e110179e43
treed9613fafeb029f43b826bd0ba78aa1e707651a88
parent9a01c31b94e54384ecab65a338f896d344bf3cad
eal: fix type casting of value to align

Fix a warning when the rte_common.h header is included in a compilation
using  -Wbad-function-cast, such as in Open vSwitch where the
following warning is emitted repeatedly:

    ../rte_common.h: In function 'rte_is_aligned':
    ../rte_common.h:184:9: warning: cast from function call of
    type 'uintptr_t' to non-matching type 'void *' [-Wbad-function-cast]

This change fixes the issue in rte_common.h by using the RTE_ALIGN_FLOOR
macro to get the aligned floor value with generic type casting.

Also removed the rte_align_floor_int() function and replaced it with
the RTE_PTR_ALIGN_FLOOR() macro.

Signed-off-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
app/test/test_common.c
lib/librte_eal/common/include/rte_common.h
lib/librte_malloc/malloc_elem.c