From: Zhiyong Yang Date: Fri, 19 Jan 2018 10:18:13 +0000 (+0800) Subject: mbuf: remove void pointer cast X-Git-Tag: spdx-start~10 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=9d46f3bbc8d84a3f4aea7e25de8d72c9548d9ad4;p=dpdk.git mbuf: remove void pointer cast It is unnecessary to cast from void * to struct rte_mbuf *, the change can make code clearer. Signed-off-by: Zhiyong Yang Acked-by: Olivier Matz --- diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h index a594e4772e..2fd4f5ef97 100644 --- a/lib/librte_mbuf/rte_mbuf.h +++ b/lib/librte_mbuf/rte_mbuf.h @@ -896,11 +896,9 @@ rte_mbuf_sanity_check(const struct rte_mbuf *m, int is_header); static inline struct rte_mbuf *rte_mbuf_raw_alloc(struct rte_mempool *mp) { struct rte_mbuf *m; - void *mb = NULL; - if (rte_mempool_get(mp, &mb) < 0) + if (rte_mempool_get(mp, (void **)&m) < 0) return NULL; - m = (struct rte_mbuf *)mb; MBUF_RAW_ALLOC_CHECK(m); return m; }