IB/i40iw: use setup_timer
authorGeliang Tang <geliangtang@gmail.com>
Sat, 22 Apr 2017 01:32:54 +0000 (09:32 +0800)
committerDoug Ledford <dledford@redhat.com>
Fri, 28 Apr 2017 17:19:05 +0000 (13:19 -0400)
Use setup_timer() instead of init_timer() to simplify the code.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/i40iw/i40iw_cm.c
drivers/infiniband/hw/i40iw/i40iw_utils.c

index 95a0586a4da81e8c8922e8c653ca0d3714cffd6a..f3bc01bce483fe5d81ba08e2a60212e4f0f32b98 100644 (file)
@@ -3184,9 +3184,8 @@ void i40iw_setup_cm_core(struct i40iw_device *iwdev)
        INIT_LIST_HEAD(&cm_core->connected_nodes);
        INIT_LIST_HEAD(&cm_core->listen_nodes);
 
-       init_timer(&cm_core->tcp_timer);
-       cm_core->tcp_timer.function = i40iw_cm_timer_tick;
-       cm_core->tcp_timer.data = (unsigned long)cm_core;
+       setup_timer(&cm_core->tcp_timer, i40iw_cm_timer_tick,
+                   (unsigned long)cm_core);
 
        spin_lock_init(&cm_core->ht_lock);
        spin_lock_init(&cm_core->listen_list_lock);
index 70c3e9e795082b7152ea754a52fc68c412dee7ca..409a3781e735db6f2072bde350815beed380425e 100644 (file)
@@ -844,10 +844,9 @@ void i40iw_terminate_start_timer(struct i40iw_sc_qp *qp)
 
        iwqp = (struct i40iw_qp *)qp->back_qp;
        i40iw_add_ref(&iwqp->ibqp);
-       init_timer(&iwqp->terminate_timer);
-       iwqp->terminate_timer.function = i40iw_terminate_timeout;
+       setup_timer(&iwqp->terminate_timer, i40iw_terminate_timeout,
+                   (unsigned long)iwqp);
        iwqp->terminate_timer.expires = jiffies + HZ;
-       iwqp->terminate_timer.data = (unsigned long)iwqp;
        add_timer(&iwqp->terminate_timer);
 }
 
@@ -1436,9 +1435,8 @@ void i40iw_hw_stats_start_timer(struct i40iw_sc_vsi *vsi)
 {
        struct i40iw_vsi_pestat *devstat = vsi->pestat;
 
-       init_timer(&devstat->stats_timer);
-       devstat->stats_timer.function = i40iw_hw_stats_timeout;
-       devstat->stats_timer.data = (unsigned long)vsi;
+       setup_timer(&devstat->stats_timer, i40iw_hw_stats_timeout,
+                   (unsigned long)vsi);
        mod_timer(&devstat->stats_timer,
                  jiffies + msecs_to_jiffies(STATS_TIMER_DELAY));
 }