Skip to content

Commit 11e54b7

Browse files
author
Sebastian Ott
committed
KVM: arm64: Switch to use hrtimer_setup()
JIRA: https://issues.redhat.com/browse/RHEL-92805 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. Signed-off-by: Nam Cao <namcao@linutronix.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/all/59f527713562ad491df7c216eeee0378e0eb2402.1738746821.git.namcao@linutronix.de (cherry picked from commit 7e5fd92) Signed-off-by: Sebastian Ott <sebott@redhat.com>
1 parent 4e8b0e1 commit 11e54b7

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

arch/arm64/kvm/arch_timer.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,8 +1070,7 @@ static void timer_context_init(struct kvm_vcpu *vcpu, int timerid)
10701070
else
10711071
ctxt->offset.vm_offset = &kvm->arch.timer_data.poffset;
10721072

1073-
hrtimer_init(&ctxt->hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS_HARD);
1074-
ctxt->hrtimer.function = kvm_hrtimer_expire;
1073+
hrtimer_setup(&ctxt->hrtimer, kvm_hrtimer_expire, CLOCK_MONOTONIC, HRTIMER_MODE_ABS_HARD);
10751074

10761075
switch (timerid) {
10771076
case TIMER_PTIMER:
@@ -1098,8 +1097,8 @@ void kvm_timer_vcpu_init(struct kvm_vcpu *vcpu)
10981097
timer_set_offset(vcpu_ptimer(vcpu), 0);
10991098
}
11001099

1101-
hrtimer_init(&timer->bg_timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS_HARD);
1102-
timer->bg_timer.function = kvm_bg_timer_expire;
1100+
hrtimer_setup(&timer->bg_timer, kvm_bg_timer_expire, CLOCK_MONOTONIC,
1101+
HRTIMER_MODE_ABS_HARD);
11031102
}
11041103

11051104
void kvm_timer_init_vm(struct kvm *kvm)

0 commit comments

Comments
 (0)