[dpdk-dev] [PATCH v2 12/12] net/bnxt: remove unnecessary variable assignment
Ajit Khaparde
ajit.khaparde at broadcom.com
Thu Oct 10 03:41:53 CEST 2019
From: Kalesh AP <kalesh-anakkur.purayil at broadcom.com>
There is no need to assign return value to a temporary variable.
Instead return error directly in case of failure.
Fixes: 1fe427fd08ee ("net/bnxt: support enable/disable interrupt")
Cc: stable at dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil at broadcom.com>
Reviewed-by: Santoshkumar Karanappa Rastapur <santosh.rastapur at broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde at broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde at broadcom.com>
---
drivers/net/bnxt/bnxt_rxq.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/drivers/net/bnxt/bnxt_rxq.c b/drivers/net/bnxt/bnxt_rxq.c
index a46f96827c..e1ed360eff 100644
--- a/drivers/net/bnxt/bnxt_rxq.c
+++ b/drivers/net/bnxt/bnxt_rxq.c
@@ -384,10 +384,9 @@ bnxt_rx_queue_intr_enable_op(struct rte_eth_dev *eth_dev, uint16_t queue_id)
if (eth_dev->data->rx_queues) {
rxq = eth_dev->data->rx_queues[queue_id];
- if (!rxq) {
- rc = -EINVAL;
- return rc;
- }
+ if (!rxq)
+ return -EINVAL;
+
cpr = rxq->cp_ring;
B_CP_DB_REARM(cpr, cpr->cp_raw_cons);
}
@@ -408,10 +407,9 @@ bnxt_rx_queue_intr_disable_op(struct rte_eth_dev *eth_dev, uint16_t queue_id)
if (eth_dev->data->rx_queues) {
rxq = eth_dev->data->rx_queues[queue_id];
- if (!rxq) {
- rc = -EINVAL;
- return rc;
- }
+ if (!rxq)
+ return -EINVAL;
+
cpr = rxq->cp_ring;
B_CP_DB_DISARM(cpr);
}
--
2.20.1 (Apple Git-117)
More information about the dev
mailing list