Skip to content

Commit fc9f59d

Browse files
covanamKAGA-KOKO
authored andcommitted
io_uring: Switch to use hrtimer_setup_on_stack()
hrtimer_setup_on_stack() takes the callback function pointer as argument and initializes the timer completely. Replace hrtimer_init_on_stack() 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> Link: https://lore.kernel.org/all/f0d4ac32ec4050710a656cee8385fa4427be33aa.1730386209.git.namcao@linutronix.de
1 parent 46d076a commit fc9f59d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

io_uring/io_uring.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2435,13 +2435,14 @@ static int io_cqring_schedule_timeout(struct io_wait_queue *iowq,
24352435
{
24362436
ktime_t timeout;
24372437

2438-
hrtimer_init_on_stack(&iowq->t, clock_id, HRTIMER_MODE_ABS);
24392438
if (iowq->min_timeout) {
24402439
timeout = ktime_add_ns(iowq->min_timeout, start_time);
2441-
iowq->t.function = io_cqring_min_timer_wakeup;
2440+
hrtimer_setup_on_stack(&iowq->t, io_cqring_min_timer_wakeup, clock_id,
2441+
HRTIMER_MODE_ABS);
24422442
} else {
24432443
timeout = iowq->timeout;
2444-
iowq->t.function = io_cqring_timer_wakeup;
2444+
hrtimer_setup_on_stack(&iowq->t, io_cqring_timer_wakeup, clock_id,
2445+
HRTIMER_MODE_ABS);
24452446
}
24462447

24472448
hrtimer_set_expires_range_ns(&iowq->t, timeout, 0);

0 commit comments

Comments
 (0)