]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
blk_iocost: Switch to use hrtimer_setup()
authorNam Cao <namcao@linutronix.de>
Wed, 5 Feb 2025 10:39:11 +0000 (11:39 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 18 Feb 2025 09:32:34 +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/196d487c925411923a2d59d4bf5e366b9dac2747.1738746821.git.namcao@linutronix.de
block/blk-iocost.c

index 65a1d4427ccf4beefeaf2e5b3478b8d300f47189..ed11438eb4be3570f2f57bd9516dddfaab8b2801 100644 (file)
@@ -3004,8 +3004,7 @@ static void ioc_pd_init(struct blkg_policy_data *pd)
        iocg->hweight_inuse = WEIGHT_ONE;
 
        init_waitqueue_head(&iocg->waitq);
-       hrtimer_init(&iocg->waitq_timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
-       iocg->waitq_timer.function = iocg_waitq_timer_fn;
+       hrtimer_setup(&iocg->waitq_timer, iocg_waitq_timer_fn, CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
 
        iocg->level = blkg->blkcg->css.cgroup->level;