ethdev: remove unnecessary NULL check

Message ID 86e8c92e29214673983f4387dfc6a24338eae714.1644409051.git.wangyunjian@huawei.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series ethdev: remove unnecessary NULL check |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/github-robot: build success github build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS

Commit Message

Yunjian Wang Feb. 9, 2022, 12:24 p.m. UTC
  This NULL check is unnecessary, 'eth_dev' is never NULL.

Fixes: 58b43c1ddfd1 ("ethdev: add telemetry endpoint for device info")
Cc: stable@dpdk.org

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
---
 lib/ethdev/rte_ethdev.c | 2 --
 1 file changed, 2 deletions(-)
  

Comments

Stephen Hemminger Feb. 9, 2022, 3:32 p.m. UTC | #1
On Wed, 9 Feb 2022 20:24:10 +0800
Yunjian Wang <wangyunjian@huawei.com> wrote:

> This NULL check is unnecessary, 'eth_dev' is never NULL.
> 
> Fixes: 58b43c1ddfd1 ("ethdev: add telemetry endpoint for device info")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>


Acked-by: Stephen Hemminger <stephen@networkplumber.org>
  
Ferruh Yigit Feb. 10, 2022, 11:14 a.m. UTC | #2
On 2/9/2022 3:32 PM, Stephen Hemminger wrote:
> On Wed, 9 Feb 2022 20:24:10 +0800
> Yunjian Wang <wangyunjian@huawei.com> wrote:
> 
>> This NULL check is unnecessary, 'eth_dev' is never NULL.
>>
>> Fixes: 58b43c1ddfd1 ("ethdev: add telemetry endpoint for device info")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
> 
> 
> Acked-by: Stephen Hemminger <stephen@networkplumber.org>

Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

Applied to dpdk-next-net/main, thanks.
  

Patch

diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
index 29e21ad580..c13149cbd3 100644
--- a/lib/ethdev/rte_ethdev.c
+++ b/lib/ethdev/rte_ethdev.c
@@ -6312,8 +6312,6 @@  eth_dev_handle_port_info(const char *cmd __rte_unused,
 		return -EINVAL;
 
 	eth_dev = &rte_eth_devices[port_id];
-	if (!eth_dev)
-		return -EINVAL;
 
 	rxq_state = rte_tel_data_alloc();
 	if (!rxq_state)