From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id CDE02A0096 for ; Thu, 6 Jun 2019 09:15:57 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CDF401B94F; Thu, 6 Jun 2019 09:15:56 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id F3CE81B94D; Thu, 6 Jun 2019 09:15:54 +0200 (CEST) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Jun 2019 00:15:53 -0700 X-ExtLoop1: 1 Received: from yexl-server.sh.intel.com (HELO localhost) ([10.67.110.206]) by fmsmga004.fm.intel.com with ESMTP; 06 Jun 2019 00:15:52 -0700 Date: Thu, 6 Jun 2019 15:15:37 +0800 From: Ye Xiaolong To: Maxime Coquelin Cc: dev@dpdk.org, ybrustin@cisco.com, tiwei.bie@intel.com, jfreimann@redhat.com, david.marchand@redhat.com, stable@dpdk.org Message-ID: <20190606071537.GA14480@intel.com> References: <20190605100039.18029-1-maxime.coquelin@redhat.com> <20190605100039.18029-5-maxime.coquelin@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190605100039.18029-5-maxime.coquelin@redhat.com> User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-dev] [PATCH v3 4/4] net/virtio: remove useless pointers checks 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 06/05, Maxime Coquelin wrote: >This patch removes uses checks on 'prev' pointer, as it s/uses/useless/ >is always set before with a valid value. > >Reviewed-by: David Marchand >Signed-off-by: Maxime Coquelin >--- > drivers/net/virtio/virtio_rxtx.c | 15 ++++----------- > 1 file changed, 4 insertions(+), 11 deletions(-) > >diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c >index 358cc86627..ca40ba9c5d 100644 >--- a/drivers/net/virtio/virtio_rxtx.c >+++ b/drivers/net/virtio/virtio_rxtx.c >@@ -1517,9 +1517,7 @@ virtio_recv_pkts_inorder(void *rx_queue, > > rx_pkts[nb_rx]->pkt_len += (uint32_t)(len[i]); > >- if (prev) >- prev->next = rxm; >- >+ prev->next = rxm; > prev = rxm; > seg_res -= 1; > } >@@ -1701,9 +1699,7 @@ virtio_recv_mergeable_pkts(void *rx_queue, > > rx_pkts[nb_rx]->pkt_len += (uint32_t)(len[i]); > >- if (prev) >- prev->next = rxm; >- >+ prev->next = rxm; > prev = rxm; > seg_res -= 1; > } >@@ -1876,9 +1872,7 @@ virtio_recv_mergeable_pkts_packed(void *rx_queue, > > rx_pkts[nb_rx]->pkt_len += (uint32_t)(len[i]); > >- if (prev) >- prev->next = rxm; >- >+ prev->next = rxm; > prev = rxm; > seg_res -= 1; > } >@@ -1921,8 +1915,7 @@ virtio_recv_mergeable_pkts_packed(void *rx_queue, > } else { > PMD_RX_LOG(ERR, > "No enough segments for packet."); >- if (prev) >- virtio_discard_rxbuf(vq, prev); >+ virtio_discard_rxbuf(vq, prev); > rxvq->stats.errors++; > break; > } >-- >2.21.0 >