diff options
author | Nam Cao <namcao@linutronix.de> | 2025-02-05 13:38:50 +0300 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2025-02-18 12:32:31 +0300 |
commit | 7d6f12520bd40f6e88e79de29808c7ae98185324 (patch) | |
tree | 42c1a99cded65d631304a90d9ca413ca879b9cb4 | |
parent | 7e5fd922c1464bd0678491f470844884af56f810 (diff) | |
download | linux-7d6f12520bd40f6e88e79de29808c7ae98185324.tar.xz |
LoongArch: KVM: 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/a5b1b53813a15a73afdfff6fbb4c9064fa582be1.1738746821.git.namcao@linutronix.de
-rw-r--r-- | arch/loongarch/kvm/vcpu.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/loongarch/kvm/vcpu.c b/arch/loongarch/kvm/vcpu.c index 20f941af3e9e..6230458d579a 100644 --- a/arch/loongarch/kvm/vcpu.c +++ b/arch/loongarch/kvm/vcpu.c @@ -1459,8 +1459,8 @@ int kvm_arch_vcpu_create(struct kvm_vcpu *vcpu) vcpu->arch.vpid = 0; vcpu->arch.flush_gpa = INVALID_GPA; - hrtimer_init(&vcpu->arch.swtimer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS_PINNED_HARD); - vcpu->arch.swtimer.function = kvm_swtimer_wakeup; + hrtimer_setup(&vcpu->arch.swtimer, kvm_swtimer_wakeup, CLOCK_MONOTONIC, + HRTIMER_MODE_ABS_PINNED_HARD); vcpu->arch.handle_exit = kvm_handle_exit; vcpu->arch.guest_eentry = (unsigned long)kvm_loongarch_ops->exc_entry; |