mempool: silence warning on pointer arithmetic
authorCyril Chemparathy <cchemparathy@ezchip.com>
Mon, 22 Jun 2015 18:34:15 +0000 (11:34 -0700)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Wed, 24 Jun 2015 10:00:28 +0000 (12:00 +0200)
commit6cf14ce4ce6cb8a9a26c20769f20a8bf34a4491f
tree2f7e9793d7bda81e884773e2ea5c2076dd971f84
parent3b5e1551b3dbe0f6b6dc4cc5ce7f5fd951984945
mempool: silence warning on pointer arithmetic

Translating from a mempool object to the mempool pointer does not break
alignment constraints.  However, the compiler is unaware of this fact and
complains on -Wcast-align.  This patch modifies the code to use RTE_PTR_SUB(),
thereby silencing the compiler by casting through (void *).

Signed-off-by: Cyril Chemparathy <cchemparathy@ezchip.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
lib/librte_mempool/rte_mempool.c
lib/librte_mempool/rte_mempool.h