summaryrefslogtreecommitdiff
path: root/lib/test_objpool.c
diff options
context:
space:
mode:
authorNam Cao <namcao@linutronix.de>2025-02-05 11:38:59 +0100
committerThomas Gleixner <tglx@linutronix.de>2025-02-18 10:32:32 +0100
commitb09dffdeb3691483fc8fbe58ff7787c964b56d5c (patch)
tree6d427e75a14aa7fa42759c07e09d1eed71e78240 /lib/test_objpool.c
parent53867760f50c2b5b6b16f1350135553dda88c461 (diff)
lib: test_objpool: Switch to use hrtimer_setup()
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/edc46fbf290b280ebe67bb0d21599c4c30716b68.1738746821.git.namcao@linutronix.de
Diffstat (limited to 'lib/test_objpool.c')
-rw-r--r--lib/test_objpool.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/test_objpool.c b/lib/test_objpool.c
index 896c0131c9a8..8f688187fa87 100644
--- a/lib/test_objpool.c
+++ b/lib/test_objpool.c
@@ -190,8 +190,7 @@ static int ot_init_hrtimer(struct ot_item *item, unsigned long hrtimer)
return -ENOENT;
item->hrtcycle = ktime_set(0, hrtimer * 1000000UL);
- hrtimer_init(hrt, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
- hrt->function = ot_hrtimer_handler;
+ hrtimer_setup(hrt, ot_hrtimer_handler, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
return 0;
}