Skip to contentSkip to conversation

drivers/net: mellanox: Convert timers to use timer_setup()

PATCH In review Kees Cook 2 participants 2 messages Oct 27, 2017 – Oct 28, 2017

Subsystems (4)
lore
Share & tools
lore

Kees Cook

author
#0 lore raw

PATCH 1/1 drivers/net: mellanox: Convert timers to use timer_setup()

In preparation for unconditionally passing the struct timer_list pointer to all timer callbacks, switch to using the new timer_setup() and from_timer() to pass the timer pointer explicitly.

Cc Saeed Mahameed <saeedm-VPRAkNaXOzVWk0Htik3J/[email protected]>
Cc Matan Barak <matanb-VPRAkNaXOzVWk0Htik3J/[email protected]>
Cc Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/[email protected]>
---
 drivers/net/ethernet/mellanox/mlx5/core/health.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/health.c +3 -3
index a89a68ce53ad..185dcac0abe7 100644
@@ -285,9 +285,9 @@ void mlx5_trigger_health_work(struct mlx5_core_dev *dev)
 	spin_unlock_irqrestore(&health->wq_lock, flags);
 }
 
-static void poll_health(unsigned long data)
+static void poll_health(struct timer_list *t)
 {
-	struct mlx5_core_dev *dev = (struct mlx5_core_dev *)data;
+	struct mlx5_core_dev *dev = from_timer(dev, t, priv.health.timer);
 	struct mlx5_core_health *health = &dev->priv.health;
 	u32 count;
 
@@ -320,7 +320,7 @@ void mlx5_start_health_poll(struct mlx5_core_dev *dev)
 {
 	struct mlx5_core_health *health = &dev->priv.health;
 
-	setup_timer(&health->timer, poll_health, (unsigned long)dev);
+	timer_setup(&health->timer, poll_health, 0);
 	health->sick = 0;
 	clear_bit(MLX5_DROP_NEW_HEALTH_WORK, &health->flags);
 	clear_bit(MLX5_DROP_NEW_RECOVERY_WORK, &health->flags);
Signature · 10 lines
2.7.4


-- 
Kees Cook
Pixel Security
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
maintainer
#1 lore raw

From: Kees Cook <[email protected]>
Date: Thu, 26 Oct 2017 22:55:20 -0700

Quoted 10 lines

In preparation for unconditionally passing the struct timer_list pointer to all timer callbacks, switch to using the new timer_setup() and from_timer() to pass the timer pointer explicitly.

Cc Saeed Mahameed <saeedm-VPRAkNaXOzVWk0Htik3J/[email protected]>
Cc Matan Barak <matanb-VPRAkNaXOzVWk0Htik3J/[email protected]>
Cc Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/[email protected]>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html