]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
LoongArch: KVM: Switch to use hrtimer_setup()
authorNam Cao <namcao@linutronix.de>
Wed, 5 Feb 2025 10:38:50 +0000 (11:38 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 18 Feb 2025 09:32:31 +0000 (10:32 +0100)
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
arch/loongarch/kvm/vcpu.c

index 20f941af3e9ea44914565a91671daef2438beeff..6230458d579a3a0f0c2fa95780de5dbe88bfbfe0 100644 (file)
@@ -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;