summaryrefslogtreecommitdiff
path: root/drivers/net/octeontx
diff options
context:
space:
mode:
authorAndrew Goodbody <andrew.goodbody@linaro.org>2025-08-05 16:45:47 +0100
committerJerome Forissier <jerome.forissier@linaro.org>2025-08-18 14:08:57 +0200
commit45eedb7b8097793242c542b68bc5d37b298808b7 (patch)
tree3b3fa4fbfa9db85021f781b2233d60e36be00649 /drivers/net/octeontx
parent0c558bbad9e7581808b358091d1fd979f860e8ac (diff)
net: octeontx: Remove unneeded code
In nicvf_rcv_pkt_handler there is no need to initialise err as it is assigned to immediately after. Also the test for !pkt will return if true meaning that pkt is guaranteed to be true after that code block and so no need to test for it and the redundant test can be removed. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Diffstat (limited to 'drivers/net/octeontx')
-rw-r--r--drivers/net/octeontx/nicvf_main.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/net/octeontx/nicvf_main.c b/drivers/net/octeontx/nicvf_main.c
index 27d0327c88a..8021cd752b5 100644
--- a/drivers/net/octeontx/nicvf_main.c
+++ b/drivers/net/octeontx/nicvf_main.c
@@ -232,7 +232,7 @@ static int nicvf_rcv_pkt_handler(struct nicvf *nic,
size_t pkt_len;
struct cqe_rx_t *cqe_rx = (struct cqe_rx_t *)cq_desc;
- int err = 0;
+ int err;
/* Check for errors */
err = nicvf_check_cqe_rx_errs(nic, cq, cq_desc);
@@ -245,8 +245,7 @@ static int nicvf_rcv_pkt_handler(struct nicvf *nic,
return -1;
}
- if (pkt)
- *ppkt = pkt;
+ *ppkt = pkt;
return pkt_len;
}