dpdk/0166-remove-unnecessary-null-checks.patch
Huisong Li 7d8194517a sig-dpdk: sync some patches for PMD/LIB/APP
Sync some patches for hns3 PMD, telemetry and testpmd. And main
modifications are as follows:
 - backport some bugfixes for hns3
 - revert Tx performance optimization for hns3
 - add Rx/Tx descriptor dump feature for hns3
 - refactor some RSS commands for testpmd
 - add ethdev telemetry private dump
 - add dmadev telemetry
 - sync telemetry lib

Signed-off-by: Huisong Li <lihuisong@huawei.com>
(cherry picked from commit 4f06d27eff9aa99c2e2073ac74328893990ed8ed)
2022-10-24 16:11:45 +08:00

51 lines
1.4 KiB
Diff

From ea171dea8f8417fe0715620a3de77e0cf3054916 Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Fri, 21 Oct 2022 15:36:42 +0800
Subject: [PATCH 166/189] remove unnecessary null checks
Functions like free, rte_free, and rte_mempool_free
already handle NULL pointer so the checks here are not necessary.
Remove redundant NULL pointer checks before free functions
found by nullfree.cocci
Note: This patch only captures some hns3 modification from the
following patch:
Fixes: 06c047b68061 ("remove unnecessary null checks")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/hns3/hns3_rxtx.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
index 8ad40a49c7..29caaeafbd 100644
--- a/drivers/net/hns3/hns3_rxtx.c
+++ b/drivers/net/hns3/hns3_rxtx.c
@@ -86,8 +86,7 @@ hns3_rx_queue_release(void *queue)
hns3_rx_queue_release_mbufs(rxq);
if (rxq->mz)
rte_memzone_free(rxq->mz);
- if (rxq->sw_ring)
- rte_free(rxq->sw_ring);
+ rte_free(rxq->sw_ring);
rte_free(rxq);
}
}
@@ -100,10 +99,8 @@ hns3_tx_queue_release(void *queue)
hns3_tx_queue_release_mbufs(txq);
if (txq->mz)
rte_memzone_free(txq->mz);
- if (txq->sw_ring)
- rte_free(txq->sw_ring);
- if (txq->free)
- rte_free(txq->free);
+ rte_free(txq->sw_ring);
+ rte_free(txq->free);
rte_free(txq);
}
}
--
2.23.0