]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
block, bfq: Switch to use hrtimer_setup()
authorNam Cao <namcao@linutronix.de>
Wed, 5 Feb 2025 10:39:09 +0000 (11:39 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 18 Feb 2025 09:32:33 +0000 (10:32 +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>
Link: https://lore.kernel.org/all/d0d57e1dab46b617856dfb93c721d221cc31ab0b.1738746821.git.namcao@linutronix.de
block/bfq-iosched.c

index 167542201603864a43ae017a85fbeecdd9de7771..abd80dc135623a0ab236719c5b98905993927520 100644 (file)
@@ -7315,9 +7315,8 @@ static int bfq_init_queue(struct request_queue *q, struct elevator_type *e)
 
        INIT_LIST_HEAD(&bfqd->dispatch);
 
-       hrtimer_init(&bfqd->idle_slice_timer, CLOCK_MONOTONIC,
-                    HRTIMER_MODE_REL);
-       bfqd->idle_slice_timer.function = bfq_idle_slice_timer;
+       hrtimer_setup(&bfqd->idle_slice_timer, bfq_idle_slice_timer, CLOCK_MONOTONIC,
+                     HRTIMER_MODE_REL);
 
        bfqd->queue_weights_tree = RB_ROOT_CACHED;
 #ifdef CONFIG_BFQ_GROUP_IOSCHED