mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-13 15:03:58 +03:00
net: octeontx: Remove unneeded test
In nicvf_cq_handler there is a test for !cqe_count which will return if true so it is guaranteed that cqe_count will true after that point. This makes the later test for cqe_count redundant so it can be removed. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
This commit is contained in:
committed by
Jerome Forissier
parent
45eedb7b80
commit
62b4a482b9
@@ -273,31 +273,29 @@ int nicvf_cq_handler(struct nicvf *nic, void **ppkt, int *pkt_len)
|
||||
cqe_head >>= 9;
|
||||
cqe_head &= 0xFFFF;
|
||||
|
||||
if (cqe_count) {
|
||||
/* Get the CQ descriptor */
|
||||
cq_desc = (struct cqe_rx_t *)GET_CQ_DESC(cq, cqe_head);
|
||||
cqe_head++;
|
||||
cqe_head &= (cq->dmem.q_len - 1);
|
||||
/* Get the CQ descriptor */
|
||||
cq_desc = (struct cqe_rx_t *)GET_CQ_DESC(cq, cqe_head);
|
||||
cqe_head++;
|
||||
cqe_head &= (cq->dmem.q_len - 1);
|
||||
|
||||
switch (cq_desc->cqe_type) {
|
||||
case CQE_TYPE_RX:
|
||||
debug("%s: Got Rx CQE\n", nic->dev->name);
|
||||
*pkt_len = nicvf_rcv_pkt_handler(nic, cq, cq_desc,
|
||||
ppkt, CQE_TYPE_RX);
|
||||
processed_rq_cqe++;
|
||||
break;
|
||||
case CQE_TYPE_SEND:
|
||||
debug("%s: Got Tx CQE\n", nic->dev->name);
|
||||
nicvf_snd_pkt_handler(nic, cq, cq_desc, CQE_TYPE_SEND);
|
||||
processed_sq_cqe++;
|
||||
break;
|
||||
default:
|
||||
debug("%s: Got CQ type %u\n", nic->dev->name,
|
||||
cq_desc->cqe_type);
|
||||
break;
|
||||
}
|
||||
processed_cqe++;
|
||||
switch (cq_desc->cqe_type) {
|
||||
case CQE_TYPE_RX:
|
||||
debug("%s: Got Rx CQE\n", nic->dev->name);
|
||||
*pkt_len = nicvf_rcv_pkt_handler(nic, cq, cq_desc,
|
||||
ppkt, CQE_TYPE_RX);
|
||||
processed_rq_cqe++;
|
||||
break;
|
||||
case CQE_TYPE_SEND:
|
||||
debug("%s: Got Tx CQE\n", nic->dev->name);
|
||||
nicvf_snd_pkt_handler(nic, cq, cq_desc, CQE_TYPE_SEND);
|
||||
processed_sq_cqe++;
|
||||
break;
|
||||
default:
|
||||
debug("%s: Got CQ type %u\n", nic->dev->name,
|
||||
cq_desc->cqe_type);
|
||||
break;
|
||||
}
|
||||
processed_cqe++;
|
||||
|
||||
/* Dequeue CQE */
|
||||
nicvf_queue_reg_write(nic, NIC_QSET_CQ_0_7_DOOR,
|
||||
|
||||
Reference in New Issue
Block a user