netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 1/2] net/mlx5e: Use PTR_ERR_OR_ZERO() to simplify code
@ 2023-08-22  2:14 Yu Liao
  2023-08-22  2:14 ` [PATCH net-next 2/2] net: dm9051: " Yu Liao
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Yu Liao @ 2023-08-22  2:14 UTC (permalink / raw)
  To: edumazet, kuba, pabeni, saeedm, leon
  Cc: liaoyu15, liwei391, davem, maciej.fijalkowski, michal.simek,
	netdev, linux-rdma

Use the standard error pointer macro to shorten the code and simplify.

Signed-off-by: Yu Liao <liaoyu15@huawei.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_fs.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c b/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c
index 934b0d5ce1b3..777d311d44ef 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c
@@ -1283,9 +1283,7 @@ static int mlx5e_create_inner_ttc_table(struct mlx5e_flow_steering *fs,
 	mlx5e_set_inner_ttc_params(fs, rx_res, &ttc_params);
 	fs->inner_ttc = mlx5_create_inner_ttc_table(fs->mdev,
 						    &ttc_params);
-	if (IS_ERR(fs->inner_ttc))
-		return PTR_ERR(fs->inner_ttc);
-	return 0;
+	return PTR_ERR_OR_ZERO(fs->inner_ttc);
 }
 
 int mlx5e_create_ttc_table(struct mlx5e_flow_steering *fs,
@@ -1295,9 +1293,7 @@ int mlx5e_create_ttc_table(struct mlx5e_flow_steering *fs,
 
 	mlx5e_set_ttc_params(fs, rx_res, &ttc_params, true);
 	fs->ttc = mlx5_create_ttc_table(fs->mdev, &ttc_params);
-	if (IS_ERR(fs->ttc))
-		return PTR_ERR(fs->ttc);
-	return 0;
+	return PTR_ERR_OR_ZERO(fs->ttc);
 }
 
 int mlx5e_create_flow_steering(struct mlx5e_flow_steering *fs,
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH net-next 2/2] net: dm9051: Use PTR_ERR_OR_ZERO() to simplify code
  2023-08-22  2:14 [PATCH net-next 1/2] net/mlx5e: Use PTR_ERR_OR_ZERO() to simplify code Yu Liao
@ 2023-08-22  2:14 ` Yu Liao
  2023-08-22 14:10 ` [PATCH net-next 1/2] net/mlx5e: " Leon Romanovsky
  2023-08-24  2:30 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Yu Liao @ 2023-08-22  2:14 UTC (permalink / raw)
  To: edumazet, kuba, pabeni, saeedm, leon
  Cc: liaoyu15, liwei391, davem, maciej.fijalkowski, michal.simek,
	netdev, linux-rdma

Use the standard error pointer macro to shorten the code and simplify.

Signed-off-by: Yu Liao <liaoyu15@huawei.com>
---
 drivers/net/ethernet/davicom/dm9051.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/davicom/dm9051.c b/drivers/net/ethernet/davicom/dm9051.c
index 70728b2e5f18..829ec35d094b 100644
--- a/drivers/net/ethernet/davicom/dm9051.c
+++ b/drivers/net/ethernet/davicom/dm9051.c
@@ -1161,9 +1161,7 @@ static int dm9051_phy_connect(struct board_info *db)
 
 	db->phydev = phy_connect(db->ndev, phy_id, dm9051_handle_link_change,
 				 PHY_INTERFACE_MODE_MII);
-	if (IS_ERR(db->phydev))
-		return PTR_ERR_OR_ZERO(db->phydev);
-	return 0;
+	return PTR_ERR_OR_ZERO(db->phydev);
 }
 
 static int dm9051_probe(struct spi_device *spi)
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next 1/2] net/mlx5e: Use PTR_ERR_OR_ZERO() to simplify code
  2023-08-22  2:14 [PATCH net-next 1/2] net/mlx5e: Use PTR_ERR_OR_ZERO() to simplify code Yu Liao
  2023-08-22  2:14 ` [PATCH net-next 2/2] net: dm9051: " Yu Liao
@ 2023-08-22 14:10 ` Leon Romanovsky
  2023-08-24  2:30 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Leon Romanovsky @ 2023-08-22 14:10 UTC (permalink / raw)
  To: Yu Liao
  Cc: edumazet, kuba, pabeni, saeedm, liwei391, davem,
	maciej.fijalkowski, michal.simek, netdev, linux-rdma

On Tue, Aug 22, 2023 at 10:14:54AM +0800, Yu Liao wrote:
> Use the standard error pointer macro to shorten the code and simplify.
> 
> Signed-off-by: Yu Liao <liaoyu15@huawei.com>
> ---
>  drivers/net/ethernet/mellanox/mlx5/core/en_fs.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 

Thanks,
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next 1/2] net/mlx5e: Use PTR_ERR_OR_ZERO() to simplify code
  2023-08-22  2:14 [PATCH net-next 1/2] net/mlx5e: Use PTR_ERR_OR_ZERO() to simplify code Yu Liao
  2023-08-22  2:14 ` [PATCH net-next 2/2] net: dm9051: " Yu Liao
  2023-08-22 14:10 ` [PATCH net-next 1/2] net/mlx5e: " Leon Romanovsky
@ 2023-08-24  2:30 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-08-24  2:30 UTC (permalink / raw)
  To: Yu Liao
  Cc: edumazet, kuba, pabeni, saeedm, leon, liwei391, davem,
	maciej.fijalkowski, michal.simek, netdev, linux-rdma

Hello:

This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Tue, 22 Aug 2023 10:14:54 +0800 you wrote:
> Use the standard error pointer macro to shorten the code and simplify.
> 
> Signed-off-by: Yu Liao <liaoyu15@huawei.com>
> ---
>  drivers/net/ethernet/mellanox/mlx5/core/en_fs.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)

Here is the summary with links:
  - [net-next,1/2] net/mlx5e: Use PTR_ERR_OR_ZERO() to simplify code
    (no matching commit)
  - [net-next,2/2] net: dm9051: Use PTR_ERR_OR_ZERO() to simplify code
    https://git.kernel.org/netdev/net-next/c/664c84c26d7a

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-08-24  2:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-22  2:14 [PATCH net-next 1/2] net/mlx5e: Use PTR_ERR_OR_ZERO() to simplify code Yu Liao
2023-08-22  2:14 ` [PATCH net-next 2/2] net: dm9051: " Yu Liao
2023-08-22 14:10 ` [PATCH net-next 1/2] net/mlx5e: " Leon Romanovsky
2023-08-24  2:30 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).