From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Ilya V. Matveychikov" Subject: [PATCH v2] mbuf: cleanup rte_pktmbuf_lastseg function Date: Sun, 10 Dec 2017 00:08:22 +0300 Message-ID: <20171209210822.21927-1-matvejchikov@gmail.com> References: <3DBFD712-8DA6-4FDB-B139-66398039B4C0@gmail.com> Cc: olivier.matz@6wind.com, "Ilya V. Matveychikov" To: dev@dpdk.org Return-path: Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by dpdk.org (Postfix) with ESMTP id 1C3A37CB6 for ; Sat, 9 Dec 2017 22:08:56 +0100 (CET) Received: by mail-wm0-f68.google.com with SMTP id g130so8546701wme.0 for ; Sat, 09 Dec 2017 13:08:56 -0800 (PST) In-Reply-To: <3DBFD712-8DA6-4FDB-B139-66398039B4C0@gmail.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" There is no reason to have local variable m2. Fixes: af75078fece3 ("first public release") Signed-off-by: Ilya V. Matveychikov --- lib/librte_mbuf/rte_mbuf.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h index ce8a05ddf..e4e3917f6 100644 --- a/lib/librte_mbuf/rte_mbuf.h +++ b/lib/librte_mbuf/rte_mbuf.h @@ -1541,12 +1541,10 @@ static inline uint16_t rte_pktmbuf_tailroom(const struct rte_mbuf *m) */ static inline struct rte_mbuf *rte_pktmbuf_lastseg(struct rte_mbuf *m) { - struct rte_mbuf *m2 = (struct rte_mbuf *)m; - __rte_mbuf_sanity_check(m, 1); - while (m2->next != NULL) - m2 = m2->next; - return m2; + while (m->next != NULL) + m = m->next; + return m; } /** -- 2.14.2