Skip to content

Commit 7f657ad

Browse files
covanamKAGA-KOKO
authored andcommitted
misc: vcpu_stall_detector: 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 <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Acked-by: Zack Rusin <[email protected]> Link: https://lore.kernel.org/all/a1c984288c6e47d956c07339ced486a8ec95f8d5.1738746904.git.namcao@linutronix.de
1 parent 3a1ed01 commit 7f657ad

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/misc/vcpu_stall_detector.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,7 @@ static int start_stall_detector_cpu(unsigned int cpu)
111111
ping_timeout_ms = vcpu_stall_config.stall_timeout_sec *
112112
MSEC_PER_SEC / 2;
113113

114-
hrtimer_init(vcpu_hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
115-
vcpu_hrtimer->function = vcpu_stall_detect_timer_fn;
114+
hrtimer_setup(vcpu_hrtimer, vcpu_stall_detect_timer_fn, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
116115
vcpu_stall_detector->is_initialized = true;
117116

118117
hrtimer_start(vcpu_hrtimer, ms_to_ktime(ping_timeout_ms),

0 commit comments

Comments
 (0)