]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
KVM: s390: Switch to use hrtimer_setup()
authorNam Cao <namcao@linutronix.de>
Wed, 5 Feb 2025 10:38:47 +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>
Acked-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Link: https://lore.kernel.org/all/637865c62963fb8cddf6c4368ca12434988a8c27.1738746821.git.namcao@linutronix.de
arch/s390/kvm/interrupt.c
arch/s390/kvm/kvm-s390.c

index 07ff0e10cb7f5c0294bf85f1d65d1eb124698705..0f00f8e85feec9d7069405ff6eb44ab0996648a7 100644 (file)
@@ -3174,8 +3174,7 @@ void kvm_s390_gisa_init(struct kvm *kvm)
        gi->alert.mask = 0;
        spin_lock_init(&gi->alert.ref_lock);
        gi->expires = 50 * 1000; /* 50 usec */
-       hrtimer_init(&gi->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
-       gi->timer.function = gisa_vcpu_kicker;
+       hrtimer_setup(&gi->timer, gisa_vcpu_kicker, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
        memset(gi->origin, 0, sizeof(struct kvm_s390_gisa));
        gi->origin->next_alert = (u32)virt_to_phys(gi->origin);
        VM_EVENT(kvm, 3, "gisa 0x%pK initialized", gi->origin);
index ebecb96bacce7d75563bd3a130a7cc31869dc254..1066c6ac59014e17b7702bf5db186b40e67129ab 100644 (file)
@@ -3943,8 +3943,8 @@ static int kvm_s390_vcpu_setup(struct kvm_vcpu *vcpu)
                if (rc)
                        return rc;
        }
-       hrtimer_init(&vcpu->arch.ckc_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
-       vcpu->arch.ckc_timer.function = kvm_s390_idle_wakeup;
+       hrtimer_setup(&vcpu->arch.ckc_timer, kvm_s390_idle_wakeup, CLOCK_MONOTONIC,
+                     HRTIMER_MODE_REL);
 
        vcpu->arch.sie_block->hpid = HPID_KVM;