ethdev: remove dead code in telemetry handler

Message ID 20220212123621.3394272-1-gmuthukrishn@marvell.com (mailing list archive)
State Rejected, archived
Delegated to: Ferruh Yigit
Headers
Series ethdev: remove dead code in telemetry handler |

Checks

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

Commit Message

Gowrishankar Muthukrishnan Feb. 12, 2022, 12:36 p.m. UTC
  In telemetry handler for port info, there is no need to check if
eth_dev object of a port id is not null, as it had already been
evaluated once in rte_eth_dev_is_valid_port function.

Fixes: 58b43c1ddfd1 ("ethdev: add telemetry endpoint for device info")
Coverity issue: 373635

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
---
 lib/ethdev/rte_ethdev.c | 2 --
 1 file changed, 2 deletions(-)
  

Comments

Ferruh Yigit Feb. 14, 2022, 12:10 p.m. UTC | #1
On 2/12/2022 12:36 PM, Gowrishankar Muthukrishnan wrote:
> In telemetry handler for port info, there is no need to check if
> eth_dev object of a port id is not null, as it had already been
> evaluated once in rte_eth_dev_is_valid_port function.
> 
> Fixes: 58b43c1ddfd1 ("ethdev: add telemetry endpoint for device info")
> Coverity issue: 373635
> 
> Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
> ---
>   lib/ethdev/rte_ethdev.c | 2 --
>   1 file changed, 2 deletions(-)
> 
> diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
> index e03e669c31..3484aa2b32 100644
> --- a/lib/ethdev/rte_ethdev.c
> +++ b/lib/ethdev/rte_ethdev.c
> @@ -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)


Hi Gowrishankar,

Thanks for the patch.
There was already a patch for it [1] and it is merged already [2].

Updating this patch status in patchwork as rejected.




[1]
https://patches.dpdk.org/project/dpdk/patch/86e8c92e29214673983f4387dfc6a24338eae714.1644409051.git.wangyunjian@huawei.com/

[2]
https://git.dpdk.org/dpdk/commit/?id=8b8dd4451da45ce0419521d7e29fe246a5278251
  

Patch

diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
index e03e669c31..3484aa2b32 100644
--- a/lib/ethdev/rte_ethdev.c
+++ b/lib/ethdev/rte_ethdev.c
@@ -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)