git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
mempool: silence warning on pointer arithmetic
[dpdk.git]
/
lib
/
librte_mempool
/
rte_mempool.c
diff --git
a/lib/librte_mempool/rte_mempool.c
b/lib/librte_mempool/rte_mempool.c
index
3cd5aab
..
02699a1
100644
(file)
--- a/
lib/librte_mempool/rte_mempool.c
+++ b/
lib/librte_mempool/rte_mempool.c
@@
-136,7
+136,7
@@
mempool_add_elem(struct rte_mempool *mp, void *obj, uint32_t obj_idx,
obj = (char *)obj + mp->header_size;
/* set mempool ptr in header */
- hdr =
(struct rte_mempool_objhdr *)((char *)obj -
sizeof(*hdr));
+ hdr =
RTE_PTR_SUB(obj,
sizeof(*hdr));
hdr->mp = mp;
#ifdef RTE_LIBRTE_MEMPOOL_DEBUG