From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out1.zte.com.cn (out1.zte.com.cn [202.103.147.172]) by dpdk.org (Postfix) with ESMTP id 7660F98 for ; Mon, 9 Jan 2017 13:43:58 +0100 (CET) X-MAILFROM: X-RCPTTO: X-FROMIP: 10.30.3.20 X-SEG-Scaned: 1 X-Received: unknown,10.30.3.20,20170109203516 Received: from unknown (HELO mse01.zte.com.cn) (10.30.3.20) by localhost with (AES256-SHA encrypted) SMTP; 9 Jan 2017 12:35:16 -0000 Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id v09Ch6R7050025; Mon, 9 Jan 2017 20:43:06 +0800 (GMT-8) (envelope-from wang.yong19@zte.com.cn) Received: from localhost.localdomain.localdomain ([10.43.166.165]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2017010920430920-980119 ; Mon, 9 Jan 2017 20:43:09 +0800 From: Yong Wang To: helin.zhang@intel.com, jingjing.wu@intel.com Cc: dev@dpdk.org, Yong Wang Date: Mon, 9 Jan 2017 08:48:52 -0500 Message-Id: <1483969732-20073-1-git-send-email-wang.yong19@zte.com.cn> X-Mailer: git-send-email 1.8.3.1 X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2017-01-09 20:43:09, Serialize by Router on notes_smtp/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2017-01-09 20:42:54, Serialize complete at 2017-01-09 20:42:54 X-MAIL: mse01.zte.com.cn v09Ch6R7050025 X-HQIP: 127.0.0.1 Subject: [dpdk-dev] [PATCH] net/i40e: remove redundant statement and braces 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: Mon, 09 Jan 2017 12:43:59 -0000 In function "reassemble_packets()", the statement "end = secondlast;" is redundant since there is another assignment "start = end = NULL;" 3 lines below. BTW, I removed the redundant braces in the conditional statement "if (end->data_len > rxq->crc_len)". Signed-off-by: Yong Wang --- drivers/net/i40e/i40e_rxtx_vec_common.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/net/i40e/i40e_rxtx_vec_common.h b/drivers/net/i40e/i40e_rxtx_vec_common.h index 6cb5dce..02d834a 100644 --- a/drivers/net/i40e/i40e_rxtx_vec_common.h +++ b/drivers/net/i40e/i40e_rxtx_vec_common.h @@ -65,9 +65,9 @@ start->ol_flags = end->ol_flags; /* we need to strip crc for the whole packet */ start->pkt_len -= rxq->crc_len; - if (end->data_len > rxq->crc_len) { + if (end->data_len > rxq->crc_len) end->data_len -= rxq->crc_len; - } else { + else { /* free up last mbuf */ struct rte_mbuf *secondlast = start; @@ -77,7 +77,6 @@ end->data_len); secondlast->next = NULL; rte_pktmbuf_free_seg(end); - end = secondlast; } pkts[pkt_idx++] = start; start = end = NULL; -- 1.8.3.1