DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Yang, Zhiyong" <zhiyong.yang@intel.com>
To: "dev@dpdk.org" <dev@dpdk.org>
Cc: "thomas@monjalon.net" <thomas@monjalon.net>,
	"Yigit, Ferruh" <ferruh.yigit@intel.com>
Subject: Re: [dpdk-dev] [PATCH] lib/librte_mbuf: remove void * pointer cast
Date: Fri, 19 Jan 2018 10:05:00 +0000	[thread overview]
Message-ID: <E182254E98A5DA4EB1E657AC7CB9BD2A8B02886D@BGSMSX101.gar.corp.intel.com> (raw)
In-Reply-To: <20180119091240.25085-1-zhiyong.yang@intel.com>

 
Drop this one since the patch doesn't follow the convention. I will resend another new one.

Thanks
Zhiyong

> -----Original Message-----
> From: Yang, Zhiyong
> Sent: Friday, January 19, 2018 5:13 PM
> To: dev@dpdk.org
> Cc: thomas@monjalon.net; Yigit, Ferruh <ferruh.yigit@intel.com>; Yang,
> Zhiyong <zhiyong.yang@intel.com>
> Subject: [PATCH] lib/librte_mbuf: remove void * pointer cast
> 
> It is unnecessary to cast from void * to struct rte_mbuf *, the change can
> make code more simple.
> 
> 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

      parent reply	other threads:[~2018-01-19 10:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-19  9:12 Zhiyong Yang
2018-01-19  9:37 ` Thomas Monjalon
2018-01-19 10:01   ` Yang, Zhiyong
2018-01-19 10:05 ` Yang, Zhiyong [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E182254E98A5DA4EB1E657AC7CB9BD2A8B02886D@BGSMSX101.gar.corp.intel.com \
    --to=zhiyong.yang@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).