[PATCH 27/31] blk_iocost: Switch to use hrtimer_setup()
From: Nam Cao
Date: Mon Oct 28 2024 - 03:40:18 EST
There is a newly introduced hrtimer_setup() which will replace
hrtimer_init(). This new function is similar to the old one, except that it
also sanity-checks and initializes the timer's callback function.
Switch to use this new function.
Patch was created by using Coccinelle.
Signed-off-by: Nam Cao <namcao@xxxxxxxxxxxxx>
---
Cc: Jens Axboe <axboe@xxxxxxxxx>
---
block/blk-iocost.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/block/blk-iocost.c b/block/blk-iocost.c
index 9dc9323f84ac..5a89535c1303 100644
--- a/block/blk-iocost.c
+++ b/block/blk-iocost.c
@@ -2997,8 +2997,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;
--
2.39.5