From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=w6CTv1bREfIiltHVTcS/JW9TGGSHSF9LpOzf7wV50v4=; b=DNQ/ywTHM4TfziJhK+EciyA+WqS2ur0jKW08PFEykDnx3uM/YxEtOXACF4IspUJEu9 Gny7WIfYz0sUBHjvO29xEsKwWxNYuKW6r8UjR2NzaR6abWgDvbzcz03b6Jy9rVWxSga3 MxWDuncR3SemfafGCukGYYUC2kdPC3EZndcNxk368gaPIgJQSzZUgIHMByzrVOMNYP4y 4mHIJW2lY2PEKvHKfXTtLU73yAHGIDlnznWan0mwwtubqT/0Ym5C5H9gZwpCBgMWcGjg e7LEvPXj0sK9DAcgbxfOVlrirFLAcTSpARaEO2XLIWOzZ0VFkD+Vu6qUBIV/YeHzdK1d 7PNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=w6CTv1bREfIiltHVTcS/JW9TGGSHSF9LpOzf7wV50v4=; b=DiW/BtB/Ud6Mfz9YtQOugifCA/ydBs1E0G+9fa8Pm/qU3Njiturtu/SO8GBpeItLH/ UKP3vnxDj815yk0ZbGf84E9JyWBj0KrBLKAGq+8JbGN1uoTyLL0P/60rBCK+59C5UTtL u7UqC1GfLlKwT5GyAiRISqPJvhcbNilFFViK9v4VslZQJGCqke1NMGZbgco+Fbf0ResT iOv53CciBEHOEgcR7bnbnLfVUhon1bp6ECeJDt8Me2ytoOF48s1v8wMeo9ayB0W0GI5K MKFyEOF3+T2Dp8gUSwRVKymmQAMS+AkOyXPM1TzoJWQenfad5iR/NZKX+5fYfduZ5zoF JYAw== X-Gm-Message-State: AJaThX6fb/quYk5P2WBQgnYez7wRMgEmtTwJ/Dvo8MpeIEJVfpxBg+i1 G2TXdrGrwjYiAvNvMV8dGEnzoriJ X-Google-Smtp-Source: AGs4zMZHPtcMR6ozlD0uIrvsUaSvzy9M6gzyo3YdSRAvEJyylvCXtyxSGL0ZhT2PbWpL9jPGOhnK+A== X-Received: by 10.80.164.27 with SMTP id u27mr53697627edb.11.1512853736281; Sat, 09 Dec 2017 13:08:56 -0800 (PST) Received: from xone.net.sahm.ae ([94.205.75.192]) by smtp.gmail.com with ESMTPSA id w51sm4741919edd.84.2017.12.09.13.08.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 09 Dec 2017 13:08:55 -0800 (PST) From: "Ilya V. Matveychikov" To: dev@dpdk.org Cc: olivier.matz@6wind.com, "Ilya V. Matveychikov" Date: Sun, 10 Dec 2017 00:08:22 +0300 Message-Id: <20171209210822.21927-1-matvejchikov@gmail.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: <3DBFD712-8DA6-4FDB-B139-66398039B4C0@gmail.com> References: <3DBFD712-8DA6-4FDB-B139-66398039B4C0@gmail.com> Subject: [dpdk-dev] [PATCH v2] mbuf: cleanup rte_pktmbuf_lastseg function 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: Sat, 09 Dec 2017 21:08:57 -0000 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