From: Maxime Coquelin Date: Wed, 5 Jun 2019 10:00:39 +0000 (+0200) Subject: net/virtio: remove useless pointer checks X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=fce066399638503ff54dda2c473333bcf6ecd231;p=dpdk.git net/virtio: remove useless pointer checks This patch removes useless checks on 'prev' pointer, as it is always set before with a valid value. Reviewed-by: David Marchand Reviewed-by: Tiwei Bie Signed-off-by: Maxime Coquelin --- diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c index 8dccd694e9..1f11784672 100644 --- a/drivers/net/virtio/virtio_rxtx.c +++ b/drivers/net/virtio/virtio_rxtx.c @@ -1512,9 +1512,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; } @@ -1696,9 +1694,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; } @@ -1871,9 +1867,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; } @@ -1916,8 +1910,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; }