]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ntb: ntb_pingpong: Switch to use hrtimer_setup()
authorNam Cao <namcao@linutronix.de>
Wed, 5 Feb 2025 10:46:08 +0000 (11:46 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 18 Feb 2025 10:19:04 +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.

Patch was created by using Coccinelle.

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/2b179e16ab830611fdcb09a33a5a531c9800679b.1738746904.git.namcao@linutronix.de
drivers/ntb/test/ntb_pingpong.c

index 8aeca7914050923133a9d57826a5baaedd85ff8d..1c1c74f4ff2d3a6f28305b37d5c8f976b06f26e6 100644 (file)
@@ -284,8 +284,7 @@ static struct pp_ctx *pp_create_data(struct ntb_dev *ntb)
        pp->ntb = ntb;
        atomic_set(&pp->count, 0);
        spin_lock_init(&pp->lock);
-       hrtimer_init(&pp->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
-       pp->timer.function = pp_timer_func;
+       hrtimer_setup(&pp->timer, pp_timer_func, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
 
        return pp;
 }