IB/qib: use setup_timer
authorGeliang Tang <geliangtang@gmail.com>
Sat, 22 Apr 2017 01:34:51 +0000 (09:34 +0800)
committerDoug Ledford <dledford@redhat.com>
Fri, 28 Apr 2017 17:19:14 +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/qib/qib_iba6120.c
drivers/infiniband/hw/qib/qib_iba7220.c
drivers/infiniband/hw/qib/qib_iba7322.c
drivers/infiniband/hw/qib/qib_init.c

index 06de1cbcf67dcf5774e5c3ab886eeffa1bd4d708..e423b71e6ea06fc86af5385fc1b27b0a5d5ad06b 100644 (file)
@@ -3295,13 +3295,11 @@ static int init_6120_variables(struct qib_devdata *dd)
        dd->rhdrhead_intr_off = 1ULL << 32;
 
        /* setup the stats timer; the add_timer is done at end of init */
-       init_timer(&dd->stats_timer);
-       dd->stats_timer.function = qib_get_6120_faststats;
-       dd->stats_timer.data = (unsigned long) dd;
+       setup_timer(&dd->stats_timer, qib_get_6120_faststats,
+                   (unsigned long)dd);
 
-       init_timer(&dd->cspec->pma_timer);
-       dd->cspec->pma_timer.function = pma_6120_timer;
-       dd->cspec->pma_timer.data = (unsigned long) ppd;
+       setup_timer(&dd->cspec->pma_timer, pma_6120_timer,
+                   (unsigned long)ppd);
 
        dd->ureg_align = qib_read_kreg32(dd, kr_palign);
 
index 55a18384c22d646b74439d7171b43e73da1391f9..c3679c48e61cafc689a6ff7a215212f26a581e4c 100644 (file)
@@ -4074,9 +4074,8 @@ static int qib_init_7220_variables(struct qib_devdata *dd)
        if (!qib_mini_init)
                qib_write_kreg(dd, kr_rcvbthqp, QIB_KD_QP);
 
-       init_timer(&ppd->cpspec->chase_timer);
-       ppd->cpspec->chase_timer.function = reenable_7220_chase;
-       ppd->cpspec->chase_timer.data = (unsigned long)ppd;
+       setup_timer(&ppd->cpspec->chase_timer, reenable_7220_chase,
+                   (unsigned long)ppd);
 
        qib_num_cfg_vls = 1; /* if any 7220's, only one VL */
 
index af9f596bb68b294cc587f13924a645ac70e6235c..bb2439fff8fa6bc7b7dfad3253a9a56af44c2b26 100644 (file)
@@ -6611,9 +6611,8 @@ static int qib_init_7322_variables(struct qib_devdata *dd)
                if (!qib_mini_init)
                        write_7322_init_portregs(ppd);
 
-               init_timer(&cp->chase_timer);
-               cp->chase_timer.function = reenable_chase;
-               cp->chase_timer.data = (unsigned long)ppd;
+               setup_timer(&cp->chase_timer, reenable_chase,
+                           (unsigned long)ppd);
 
                ppd++;
        }
@@ -6639,9 +6638,8 @@ static int qib_init_7322_variables(struct qib_devdata *dd)
                (u64) rcv_int_count << IBA7322_HDRHEAD_PKTINT_SHIFT;
 
        /* setup the stats timer; the add_timer is done at end of init */
-       init_timer(&dd->stats_timer);
-       dd->stats_timer.function = qib_get_7322_faststats;
-       dd->stats_timer.data = (unsigned long) dd;
+       setup_timer(&dd->stats_timer, qib_get_7322_faststats,
+                   (unsigned long)dd);
 
        dd->ureg_align = 0x10000;  /* 64KB alignment */
 
index b50240b1d5a441998a756127c31482cad3cd9d57..6c16ba1107ba55d0dccb4e4ba831d74c007164d3 100644 (file)
@@ -233,9 +233,8 @@ int qib_init_pportdata(struct qib_pportdata *ppd, struct qib_devdata *dd,
        spin_lock_init(&ppd->cc_shadow_lock);
        init_waitqueue_head(&ppd->state_wait);
 
-       init_timer(&ppd->symerr_clear_timer);
-       ppd->symerr_clear_timer.function = qib_clear_symerror_on_linkup;
-       ppd->symerr_clear_timer.data = (unsigned long)ppd;
+       setup_timer(&ppd->symerr_clear_timer, qib_clear_symerror_on_linkup,
+                   (unsigned long)ppd);
 
        ppd->qib_wq = NULL;
        ppd->ibport_data.pmastats =
@@ -429,9 +428,8 @@ static int loadtime_init(struct qib_devdata *dd)
        qib_get_eeprom_info(dd);
 
        /* setup time (don't start yet) to verify we got interrupt */
-       init_timer(&dd->intrchk_timer);
-       dd->intrchk_timer.function = verify_interrupt;
-       dd->intrchk_timer.data = (unsigned long) dd;
+       setup_timer(&dd->intrchk_timer, verify_interrupt,
+                   (unsigned long)dd);
 done:
        return ret;
 }
@@ -755,9 +753,8 @@ done:
                                continue;
                        if (dd->flags & QIB_HAS_SEND_DMA)
                                ret = qib_setup_sdma(ppd);
-                       init_timer(&ppd->hol_timer);
-                       ppd->hol_timer.function = qib_hol_event;
-                       ppd->hol_timer.data = (unsigned long)ppd;
+                       setup_timer(&ppd->hol_timer, qib_hol_event,
+                                   (unsigned long)ppd);
                        ppd->hol_state = QIB_HOL_UP;
                }