From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from rcdn-iport-4.cisco.com (rcdn-iport-4.cisco.com [173.37.86.75]) by dpdk.org (Postfix) with ESMTP id B840B1B1C3 for ; Tue, 14 Nov 2017 21:32:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1330; q=dns/txt; s=iport; t=1510691559; x=1511901159; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=JNGWlVAA7X12N0JMOj33D45Cr/grMpovlKp5s0R9yLk=; b=S7juVJKCFZUsMomm0cchUnTEfI22KQ7yKJpYEBDzDIfBgv2VmCskcNUj L9wMj+Vg6I/AhqpCL8FEfKN4tZX4Vf0y9valpVHrN0LFI5QMwQOU5a9u3 HOxklErs9o9h4nfqE2VNF8uiF9sGE+3h/dkwJROM8B3FBPT6flC3Kc3ra 0=; X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0C7AABTUgta/4ENJK1dGQEBAQEBAQEBA?= =?us-ascii?q?QEBAQcBAQEBAYM2ZG4nB44WjzGBfYhYiQ6EcYIRChuFIAKFAT8YAQEBAQEBAQE?= =?us-ascii?q?BayiFHgEBAQEDJxM/DAQCAQgOAwQBAR8JByERFAkIAgQBDQUIigMDFaxxOoc+D?= =?us-ascii?q?YNJAQEBAQEBAQEBAQEBAQEBAQEBAQEBHYM0ggeBVYFpgyqCa4glBaF3PQKHa4g?= =?us-ascii?q?ghHCCfZBOSIxfiFcCERkBgTgBHziBc3oVgy0JgwiBTneHWQGBEAEBAQ?= X-IronPort-AV: E=Sophos;i="5.44,396,1505779200"; d="scan'208";a="320611533" Received: from alln-core-9.cisco.com ([173.36.13.129]) by rcdn-iport-4.cisco.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 14 Nov 2017 20:32:38 +0000 Received: from XCH-RTP-020.cisco.com (xch-rtp-020.cisco.com [64.101.220.160]) by alln-core-9.cisco.com (8.14.5/8.14.5) with ESMTP id vAEKWboi020010 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=FAIL); Tue, 14 Nov 2017 20:32:38 GMT Received: from xch-rtp-017.cisco.com (64.101.220.157) by XCH-RTP-020.cisco.com (64.101.220.160) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Tue, 14 Nov 2017 15:32:37 -0500 Received: from xch-rtp-017.cisco.com ([64.101.220.157]) by XCH-RTP-017.cisco.com ([64.101.220.157]) with mapi id 15.00.1320.000; Tue, 14 Nov 2017 15:32:37 -0500 From: "Hanoch Haim (hhaim)" To: Ilya Matveychikov , "dev@dpdk.org" CC: "Hanoch Haim (hhaim)" Thread-Topic: [dpdk-dev] [PATCH] mbuf: cleanup rte_pktmbuf_lastseg(), remove useless variable Thread-Index: AQHTXU7E4Hc92DZKFUyWj4hkv2wH6KMUVIaw Date: Tue, 14 Nov 2017 20:32:37 +0000 Message-ID: References: <3DBFD712-8DA6-4FDB-B139-66398039B4C0@gmail.com> In-Reply-To: <3DBFD712-8DA6-4FDB-B139-66398039B4C0@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [64.103.125.33] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] mbuf: cleanup rte_pktmbuf_lastseg(), remove useless variable 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: Tue, 14 Nov 2017 20:32:40 -0000 I would add this too=20 - } else if (rte_atomic16_add_return(&m->refcnt_atomic, -1) =3D=3D 0) Should be : + } else if (likely(rte_mbuf_refcnt_update(m, -1) =3D=3D 0)) { Hanoh -----Original Message----- From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Ilya Matveychikov Sent: Tuesday, November 14, 2017 3:45 PM To: dev@dpdk.org Subject: [dpdk-dev] [PATCH] mbuf: cleanup rte_pktmbuf_lastseg(), remove use= less variable Fixes: af75078fece3 ("first public release") Cc: intel.com Signed-off-by: Ilya V. Matveychikov --- There is no reason to have local variable m2 or am I wrong? 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 = 7e326bbc2..be79e3728 100644 --- a/lib/librte_mbuf/rte_mbuf.h +++ b/lib/librte_mbuf/rte_mbuf.h @@ -1538,12 +1538,10 @@ static inline uint16_t rte_pktmbuf_tailroom(const s= truct rte_mbuf *m) */ static inline struct rte_mbuf *rte_pktmbuf_lastseg(struct rte_mbuf *m) { - struct rte_mbuf *m2 =3D (struct rte_mbuf *)m; - __rte_mbuf_sanity_check(m, 1); - while (m2->next !=3D NULL) - m2 =3D m2->next; - return m2; + while (m->next !=3D NULL) + m =3D m->next; + return m; } /** -- 2.15.0