ethdev: remove unnecessary null check
authorYunjian Wang <wangyunjian@huawei.com>
Wed, 9 Feb 2022 12:24:10 +0000 (20:24 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 10 Feb 2022 11:00:22 +0000 (12:00 +0100)
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>
lib/ethdev/rte_ethdev.c

index 3755a31..155978c 100644 (file)
@@ -6465,8 +6465,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)