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 AD476A0096 for ; Wed, 5 Jun 2019 12:01:50 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B41101BB09; Wed, 5 Jun 2019 12:01:21 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 563AA1B9FA; Wed, 5 Jun 2019 12:01:19 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C4B1285546; Wed, 5 Jun 2019 10:01:08 +0000 (UTC) Received: from localhost.localdomain (ovpn-112-53.ams2.redhat.com [10.36.112.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id E17031001DD2; Wed, 5 Jun 2019 10:01:06 +0000 (UTC) From: Maxime Coquelin To: dev@dpdk.org, ybrustin@cisco.com, tiwei.bie@intel.com, jfreimann@redhat.com, david.marchand@redhat.com Cc: stable@dpdk.org, Maxime Coquelin Date: Wed, 5 Jun 2019 12:00:39 +0200 Message-Id: <20190605100039.18029-5-maxime.coquelin@redhat.com> In-Reply-To: <20190605100039.18029-1-maxime.coquelin@redhat.com> References: <20190605100039.18029-1-maxime.coquelin@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 05 Jun 2019 10:01:18 +0000 (UTC) Subject: [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" This patch removes uses checks on 'prev' pointer, as it 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