From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 8ABA51B2A4 for ; Fri, 19 Jan 2018 11:18:18 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Jan 2018 02:18:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,381,1511856000"; d="scan'208";a="12378278" Received: from unknown (HELO dpdk5.bj.intel.com) ([172.16.182.198]) by fmsmga002.fm.intel.com with ESMTP; 19 Jan 2018 02:18:15 -0800 From: Zhiyong Yang To: dev@dpdk.org Cc: ferruh.yigit@intel.com, thomas@monjalon.net, olivier.matz@6wind.com, Zhiyong Yang Date: Fri, 19 Jan 2018 18:18:13 +0800 Message-Id: <20180119101813.31450-1-zhiyong.yang@intel.com> X-Mailer: git-send-email 2.13.3 Subject: [dpdk-dev] [PATCH] mbuf: remove void pointer cast X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 10:18:18 -0000 It is unnecessary to cast from void * to struct rte_mbuf *, the change can make code clearer. Signed-off-by: Zhiyong Yang --- 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