Skip to contentSkip to conversation

net/mlx5: Use to_delayed_work()

PATCH Applied Chen Ni 4 participants 4 messages May 14, 2025 – May 15, 2025

Subsystems (4)
lore
Share & tools
lore

Chen Ni

author
#0 lore raw

PATCH v2 1/1 net/mlx5: Use to_delayed_work()

Use to_delayed_work() instead of open-coding it.

---
Changelog:

v1 -> v2:

1. Specify the target tree.

---
 drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/cmd.c +1 -2
index e53dbdc0a7a1..b1aeea7c4a91 100644
@@ -927,8 +927,7 @@ static void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, u64 vec, bool force
 
 static void cb_timeout_handler(struct work_struct *work)
 {
-	struct delayed_work *dwork = container_of(work, struct delayed_work,
-						  work);
+	struct delayed_work *dwork = to_delayed_work(work);
 	struct mlx5_cmd_work_ent *ent = container_of(dwork,
 						     struct mlx5_cmd_work_ent,
 						     cb_timeout_work);
Signature · 1 line
2.25.1
maintainer Acked-by on v2 1/1
#1 lore raw
Quoted 18 lines · Chen Ni

Use to_delayed_work() instead of open-coding it.

---
Changelog:

v1 -> v2:

1. Specify the target tree.

---
 drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/cmd.c +0 -0
index e53dbdc0a7a1..b1aeea7c4a91 100644

drivers/net/ethernet/mellanox/mlx5/core/cmd.c static void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, u64 vec, bool force · line 933

Quoted 9 lines
drivers/net/ethernet/mellanox/mlx5/core/cmd.c +1 -2
@@ -927,8 +927,7 @@ static void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, u64 vec, bool force
 
 static void cb_timeout_handler(struct work_struct *work)
 {
-	struct delayed_work *dwork = container_of(work, struct delayed_work,
-						  work);
+	struct delayed_work *dwork = to_delayed_work(work);
 	struct mlx5_cmd_work_ent *ent = container_of(dwork,
 						     struct mlx5_cmd_work_ent,
 						     cb_timeout_work);
Reviewed-by on v2 1/1
#2 lore raw
In reply to Chen Ni
Quoted 18 lines · Chen Ni

Use to_delayed_work() instead of open-coding it.

---
Changelog:

v1 -> v2:

1. Specify the target tree.

---
  drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/cmd.c +0 -0
index e53dbdc0a7a1..b1aeea7c4a91 100644

drivers/net/ethernet/mellanox/mlx5/core/cmd.c static void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, u64 vec, bool force · line 933

Quoted 9 lines
drivers/net/ethernet/mellanox/mlx5/core/cmd.c +1 -2
@@ -927,8 +927,7 @@ static void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, u64 vec, bool force
 
  static void cb_timeout_handler(struct work_struct *work)
  {
-	struct delayed_work *dwork = container_of(work, struct delayed_work,
-						  work);
+	struct delayed_work *dwork = to_delayed_work(work);
  	struct mlx5_cmd_work_ent *ent = container_of(dwork,
  						     struct mlx5_cmd_work_ent,
  						     cb_timeout_work);

Thanks for your patch.

#3 lore raw
In reply to Chen Ni
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 9 lines · On Wed, 14 May 2025 15:24:19 +0800 you wrote:

Use to_delayed_work() instead of open-coding it.

---
Changelog:

v1 -> v2:

[...]

Here is the summary with links:
- [net-next,v2] net/mlx5: Use to_delayed_work()

    https://git.kernel.org/netdev/net-next/c/ee39bae6c141

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html