[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <b9bb889aa1ba4f57576061e45a751137608e1dea.1729864615.git.namcao@linutronix.de>
Date: Mon, 28 Oct 2024 08:29:38 +0100
From: Nam Cao <namcao@...utronix.de>
To: Anna-Maria Behnsen <anna-maria@...utronix.de>,
Frederic Weisbecker <frederic@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Andreas Hindborg <a.hindborg@...nel.org>,
Alice Ryhl <aliceryhl@...gle.com>,
Miguel Ojeda <ojeda@...nel.org>,
Kees Cook <kees@...nel.org>,
linux-kernel@...r.kernel.org
Cc: Nam Cao <namcao@...utronix.de>,
Jens Axboe <axboe@...nel.dk>
Subject: [PATCH 19/21] io_uring: Switch to use hrtimer_setup_on_stack()
There is a newly introduced function hrtimer_setup_on_stack(), which will
replace hrtimer_init_on_stack(). In addition to what
hrtimer_init_on_stack() does, this new function also sanity-checks and
initializes the callback function pointer.
Switch to use the new function.
Signed-off-by: Nam Cao <namcao@...utronix.de>
---
Cc: Jens Axboe <axboe@...nel.dk>
---
io_uring/io_uring.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index feb61d68dca6..0842aa3f60e7 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -2435,13 +2435,14 @@ static int io_cqring_schedule_timeout(struct io_wait_queue *iowq,
{
ktime_t timeout;
- hrtimer_init_on_stack(&iowq->t, clock_id, HRTIMER_MODE_ABS);
if (iowq->min_timeout) {
timeout = ktime_add_ns(iowq->min_timeout, start_time);
- iowq->t.function = io_cqring_min_timer_wakeup;
+ hrtimer_setup_on_stack(&iowq->t, io_cqring_min_timer_wakeup, clock_id,
+ HRTIMER_MODE_ABS);
} else {
timeout = iowq->timeout;
- iowq->t.function = io_cqring_timer_wakeup;
+ hrtimer_setup_on_stack(&iowq->t, io_cqring_timer_wakeup, clock_id,
+ HRTIMER_MODE_ABS);
}
hrtimer_set_expires_range_ns(&iowq->t, timeout, 0);
--
2.39.5
Powered by blists - more mailing lists