From fce71ed2d2f18f7afa71f06fc9926c79676a98f9 Mon Sep 17 00:00:00 2001 From: "Ilya V. Matveychikov" Date: Sun, 10 Dec 2017 00:08:22 +0300 Subject: [PATCH] mbuf: cleanup function to get last segment There is no reason to have local variable m2. Fixes: af75078fece3 ("first public release") Signed-off-by: Ilya V. Matveychikov Acked-by: Olivier Matz --- 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 ce8a05ddf9..e4e3917f64 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.20.1