2023-01-18 11:10:42

by Siddharth Vadapalli

[permalink] [raw]
Subject: [PATCH net-next v3 1/2] net: ethernet: ti: am65-cpsw: Delete unreachable error handling code

The am65_cpts_create() function returns -EOPNOTSUPP only when the config
"CONFIG_TI_K3_AM65_CPTS" is disabled. Also, in the am65_cpsw_init_cpts()
function, am65_cpts_create() can only be invoked if the config
"CONFIG_TI_K3_AM65_CPTS" is enabled. Thus, the error handling code for the
case in which the return value of am65_cpts_create() is -EOPNOTSUPP, is
unreachable. Hence delete it.

Reported-by: Leon Romanovsky <[email protected]>
Signed-off-by: Siddharth Vadapalli <[email protected]>
---
drivers/net/ethernet/ti/am65-cpsw-nuss.c | 5 -----
1 file changed, 5 deletions(-)

diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
index 5cac98284184..7363e01e7579 100644
--- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c
+++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
@@ -1935,11 +1935,6 @@ static int am65_cpsw_init_cpts(struct am65_cpsw_common *common)
int ret = PTR_ERR(cpts);

of_node_put(node);
- if (ret == -EOPNOTSUPP) {
- dev_info(dev, "cpts disabled\n");
- return 0;
- }
-
dev_err(dev, "cpts create err %d\n", ret);
return ret;
}
--
2.25.1


2023-01-18 13:11:26

by Leon Romanovsky

[permalink] [raw]
Subject: Re: [PATCH net-next v3 1/2] net: ethernet: ti: am65-cpsw: Delete unreachable error handling code

On Wed, Jan 18, 2023 at 03:24:38PM +0530, Siddharth Vadapalli wrote:
> The am65_cpts_create() function returns -EOPNOTSUPP only when the config
> "CONFIG_TI_K3_AM65_CPTS" is disabled. Also, in the am65_cpsw_init_cpts()
> function, am65_cpts_create() can only be invoked if the config
> "CONFIG_TI_K3_AM65_CPTS" is enabled. Thus, the error handling code for the
> case in which the return value of am65_cpts_create() is -EOPNOTSUPP, is
> unreachable. Hence delete it.
>
> Reported-by: Leon Romanovsky <[email protected]>
> Signed-off-by: Siddharth Vadapalli <[email protected]>
> ---
> drivers/net/ethernet/ti/am65-cpsw-nuss.c | 5 -----
> 1 file changed, 5 deletions(-)
>

Thanks,
Reviewed-by: Leon Romanovsky <[email protected]>