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 <david.marchand@redhat.com> Reviewed-by: Tiwei Bie <tiwei.bie@intel.com> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
This commit is contained in:
parent
3291bb21bb
commit
fce0663996
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user