Skip to content

Commit bbdafde

Browse files
covanamKAGA-KOKO
authored andcommitted
RDMA: Switch to use hrtimer_setup()
hrtimer_setup() takes the callback function pointer as argument and initializes the timer completely. Replace hrtimer_init() and the open coded initialization of hrtimer::function with the new setup mechanism. Signed-off-by: Nam Cao <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Acked-by: Zack Rusin <[email protected]> Link: https://lore.kernel.org/all/37bd6895bb946f6d785ab5fe32f1a6f4b9e77c26.1738746904.git.namcao@linutronix.de
1 parent 7b5edfd commit bbdafde

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

drivers/infiniband/hw/hfi1/init.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -635,12 +635,11 @@ void hfi1_init_pportdata(struct pci_dev *pdev, struct hfi1_pportdata *ppd,
635635
spin_lock_init(&ppd->cca_timer_lock);
636636

637637
for (i = 0; i < OPA_MAX_SLS; i++) {
638-
hrtimer_init(&ppd->cca_timer[i].hrtimer, CLOCK_MONOTONIC,
639-
HRTIMER_MODE_REL);
640638
ppd->cca_timer[i].ppd = ppd;
641639
ppd->cca_timer[i].sl = i;
642640
ppd->cca_timer[i].ccti = 0;
643-
ppd->cca_timer[i].hrtimer.function = cca_timer_fn;
641+
hrtimer_setup(&ppd->cca_timer[i].hrtimer, cca_timer_fn, CLOCK_MONOTONIC,
642+
HRTIMER_MODE_REL);
644643
}
645644

646645
ppd->cc_max_table_entries = IB_CC_TABLE_CAP_DEFAULT;

drivers/infiniband/sw/rdmavt/qp.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,9 +1107,8 @@ int rvt_create_qp(struct ib_qp *ibqp, struct ib_qp_init_attr *init_attr,
11071107
}
11081108
/* initialize timers needed for rc qp */
11091109
timer_setup(&qp->s_timer, rvt_rc_timeout, 0);
1110-
hrtimer_init(&qp->s_rnr_timer, CLOCK_MONOTONIC,
1111-
HRTIMER_MODE_REL);
1112-
qp->s_rnr_timer.function = rvt_rc_rnr_retry;
1110+
hrtimer_setup(&qp->s_rnr_timer, rvt_rc_rnr_retry, CLOCK_MONOTONIC,
1111+
HRTIMER_MODE_REL);
11131112

11141113
/*
11151114
* Driver needs to set up it's private QP structure and do any

0 commit comments

Comments
 (0)