git.droids-corp.org
/
dpdk.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7919017
)
mbuf: remove void pointer cast
author
Zhiyong Yang
<zhiyong.yang@intel.com>
Fri, 19 Jan 2018 10:18:13 +0000
(18:18 +0800)
committer
Thomas Monjalon
<thomas@monjalon.net>
Thu, 25 Jan 2018 21:48:36 +0000
(22:48 +0100)
It is unnecessary to cast from void * to struct rte_mbuf *,
the change can make code clearer.
Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
lib/librte_mbuf/rte_mbuf.h
patch
|
blob
|
history
diff --git
a/lib/librte_mbuf/rte_mbuf.h
b/lib/librte_mbuf/rte_mbuf.h
index
a594e47
..
2fd4f5e
100644
(file)
--- 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;
}