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

index 60b43ea85c125fe9a204abfd3dd5339708a22ee1..cef3c423a41ae08bcd39a08254e1a2b72306d0c3 100644 (file)
@@ -288,9 +288,8 @@ int kvm_arch_vcpu_create(struct kvm_vcpu *vcpu)
        if (err)
                return err;
 
-       hrtimer_init(&vcpu->arch.comparecount_timer, CLOCK_MONOTONIC,
-                    HRTIMER_MODE_REL);
-       vcpu->arch.comparecount_timer.function = kvm_mips_comparecount_wakeup;
+       hrtimer_setup(&vcpu->arch.comparecount_timer, kvm_mips_comparecount_wakeup, CLOCK_MONOTONIC,
+                     HRTIMER_MODE_REL);
 
        /*
         * Allocate space for host mode exception handlers that handle