* [dpdk-dev] [PATCH] mbuf: remove void pointer cast
@ 2018-01-19 10:18 Zhiyong Yang
2018-01-22 13:07 ` Olivier Matz
0 siblings, 1 reply; 4+ messages in thread
From: Zhiyong Yang @ 2018-01-19 10:18 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, thomas, olivier.matz, Zhiyong Yang
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>
---
lib/librte_mbuf/rte_mbuf.h | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index a594e4772..2fd4f5ef9 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;
}
--
2.13.3
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH] mbuf: remove void pointer cast
2018-01-19 10:18 [dpdk-dev] [PATCH] mbuf: remove void pointer cast Zhiyong Yang
@ 2018-01-22 13:07 ` Olivier Matz
2018-01-23 1:15 ` Yang, Zhiyong
2018-01-25 21:51 ` Thomas Monjalon
0 siblings, 2 replies; 4+ messages in thread
From: Olivier Matz @ 2018-01-22 13:07 UTC (permalink / raw)
To: Zhiyong Yang; +Cc: dev, ferruh.yigit, thomas
On Fri, Jan 19, 2018 at 06:18:13PM +0800, Zhiyong Yang wrote:
> 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>
Zhihong, for next time please prefix the patch with "PATCH v2"
and use --in-reply-to with the message id of the first version.
Thanks
Olivier
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH] mbuf: remove void pointer cast
2018-01-22 13:07 ` Olivier Matz
@ 2018-01-23 1:15 ` Yang, Zhiyong
2018-01-25 21:51 ` Thomas Monjalon
1 sibling, 0 replies; 4+ messages in thread
From: Yang, Zhiyong @ 2018-01-23 1:15 UTC (permalink / raw)
To: Olivier Matz; +Cc: dev, Yigit, Ferruh, thomas
Olivier,
Thanks for your review and Acked-by, I will do that as you said next time.
Zhiyong
> -----Original Message-----
> From: Olivier Matz [mailto:olivier.matz@6wind.com]
> Sent: Monday, January 22, 2018 9:07 PM
> To: Yang, Zhiyong <zhiyong.yang@intel.com>
> Cc: dev@dpdk.org; Yigit, Ferruh <ferruh.yigit@intel.com>;
> thomas@monjalon.net
> Subject: Re: [PATCH] mbuf: remove void pointer cast
>
> On Fri, Jan 19, 2018 at 06:18:13PM +0800, Zhiyong Yang wrote:
> > 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>
>
> Zhihong, for next time please prefix the patch with "PATCH v2"
> and use --in-reply-to with the message id of the first version.
>
> Thanks
> Olivier
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH] mbuf: remove void pointer cast
2018-01-22 13:07 ` Olivier Matz
2018-01-23 1:15 ` Yang, Zhiyong
@ 2018-01-25 21:51 ` Thomas Monjalon
1 sibling, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2018-01-25 21:51 UTC (permalink / raw)
To: Zhiyong Yang; +Cc: dev, Olivier Matz, ferruh.yigit
22/01/2018 14:07, Olivier Matz:
> On Fri, Jan 19, 2018 at 06:18:13PM +0800, Zhiyong Yang wrote:
> > 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>
Applied, thanks
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-01-25 21:52 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-19 10:18 [dpdk-dev] [PATCH] mbuf: remove void pointer cast Zhiyong Yang
2018-01-22 13:07 ` Olivier Matz
2018-01-23 1:15 ` Yang, Zhiyong
2018-01-25 21:51 ` Thomas Monjalon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).