]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
RDMA: Switch to use hrtimer_setup()
authorNam Cao <namcao@linutronix.de>
Wed, 5 Feb 2025 10:46:30 +0000 (11:46 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 18 Feb 2025 10:19:07 +0000 (11:19 +0100)
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 <namcao@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Zack Rusin <zack.rusin@broadcom.com>
Link: https://lore.kernel.org/all/37bd6895bb946f6d785ab5fe32f1a6f4b9e77c26.1738746904.git.namcao@linutronix.de
drivers/infiniband/hw/hfi1/init.c
drivers/infiniband/sw/rdmavt/qp.c

index cbac4a442d9ec6eb050910366e162919a24383e2..d6fbd9c2b8b49d45c47367683d15265f0643c4de 100644 (file)
@@ -635,12 +635,11 @@ void hfi1_init_pportdata(struct pci_dev *pdev, struct hfi1_pportdata *ppd,
        spin_lock_init(&ppd->cca_timer_lock);
 
        for (i = 0; i < OPA_MAX_SLS; i++) {
-               hrtimer_init(&ppd->cca_timer[i].hrtimer, CLOCK_MONOTONIC,
-                            HRTIMER_MODE_REL);
                ppd->cca_timer[i].ppd = ppd;
                ppd->cca_timer[i].sl = i;
                ppd->cca_timer[i].ccti = 0;
-               ppd->cca_timer[i].hrtimer.function = cca_timer_fn;
+               hrtimer_setup(&ppd->cca_timer[i].hrtimer, cca_timer_fn, CLOCK_MONOTONIC,
+                             HRTIMER_MODE_REL);
        }
 
        ppd->cc_max_table_entries = IB_CC_TABLE_CAP_DEFAULT;
index e6203e26cc064fbb8b729b416d426c41caa0e628..614009fb963294c09eb04f31ce98023b3024f644 100644 (file)
@@ -1107,9 +1107,8 @@ int rvt_create_qp(struct ib_qp *ibqp, struct ib_qp_init_attr *init_attr,
                }
                /* initialize timers needed for rc qp */
                timer_setup(&qp->s_timer, rvt_rc_timeout, 0);
-               hrtimer_init(&qp->s_rnr_timer, CLOCK_MONOTONIC,
-                            HRTIMER_MODE_REL);
-               qp->s_rnr_timer.function = rvt_rc_rnr_retry;
+               hrtimer_setup(&qp->s_rnr_timer, rvt_rc_rnr_retry, CLOCK_MONOTONIC,
+                             HRTIMER_MODE_REL);
 
                /*
                 * Driver needs to set up it's private QP structure and do any