net/mlx5: Use to_delayed_work()
authorChen Ni <nichen@iscas.ac.cn>
Wed, 14 May 2025 07:24:19 +0000 (15:24 +0800)
committerJakub Kicinski <kuba@kernel.org>
Thu, 15 May 2025 14:41:36 +0000 (07:41 -0700)
Use to_delayed_work() instead of open-coding it.

Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Acked-by: Mark Bloch <mbloch@nvidia.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20250514072419.2707578-1-nichen@iscas.ac.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/cmd.c

index e53dbdc0a7a17e4627bed12a501976d065cd8d59..b1aeea7c4a917552cecac74f4922fc2707814246 100644 (file)
@@ -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);