RISC-V: KVM: Make kvm_riscv_guest_timer_init a void function
authorNikolay Borisov <nborisov@suse.com>
Fri, 29 Jul 2022 11:44:26 +0000 (17:14 +0530)
committerAnup Patel <anup@brainfault.org>
Fri, 29 Jul 2022 11:44:26 +0000 (17:14 +0530)
It can never fail so convey that fact explicitly by making the function
void. Also in kvm_arch_init_vm it makes it clear that there no need
to do any cleanup after kvm_riscv_gstage_vmid_init has been called.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Anup Patel <anup@brainfault.org>
arch/riscv/include/asm/kvm_vcpu_timer.h
arch/riscv/kvm/vcpu_timer.c
arch/riscv/kvm/vm.c

index 375281eb49e05c852160c8bd214b2ff6250b57e9..50138e2eb91b90da96ff0ce12261954ccfc77ca2 100644 (file)
@@ -39,6 +39,6 @@ int kvm_riscv_vcpu_timer_init(struct kvm_vcpu *vcpu);
 int kvm_riscv_vcpu_timer_deinit(struct kvm_vcpu *vcpu);
 int kvm_riscv_vcpu_timer_reset(struct kvm_vcpu *vcpu);
 void kvm_riscv_vcpu_timer_restore(struct kvm_vcpu *vcpu);
-int kvm_riscv_guest_timer_init(struct kvm *kvm);
+void kvm_riscv_guest_timer_init(struct kvm *kvm);
 
 #endif
index 5c4c37ff2d48531a2cbf5a56ed827e353630218c..595043857049d082aad53d196ca47685b733a8d1 100644 (file)
@@ -214,12 +214,10 @@ void kvm_riscv_vcpu_timer_restore(struct kvm_vcpu *vcpu)
 #endif
 }
 
-int kvm_riscv_guest_timer_init(struct kvm *kvm)
+void kvm_riscv_guest_timer_init(struct kvm *kvm)
 {
        struct kvm_guest_timer *gt = &kvm->arch.timer;
 
        riscv_cs_get_mult_shift(&gt->nsec_mult, &gt->nsec_shift);
        gt->time_delta = -get_cycles64();
-
-       return 0;
 }
index 945a2bf5e3f63c453742f031895c39792f3cb108..65a964d7e70d89ec988b1e9b7392abd8cdfc7317 100644 (file)
@@ -41,7 +41,9 @@ int kvm_arch_init_vm(struct kvm *kvm, unsigned long type)
                return r;
        }
 
-       return kvm_riscv_guest_timer_init(kvm);
+       kvm_riscv_guest_timer_init(kvm);
+
+       return 0;
 }
 
 void kvm_arch_destroy_vm(struct kvm *kvm)