KVM: remove unneeded return value of vcpu_postcreate
authorDominik Dingel <dingel@linux.vnet.ibm.com>
Thu, 4 Dec 2014 14:47:07 +0000 (15:47 +0100)
committerChristian Borntraeger <borntraeger@de.ibm.com>
Fri, 23 Jan 2015 12:24:52 +0000 (13:24 +0100)
The return value of kvm_arch_vcpu_postcreate is not checked in its
caller.  This is okay, because only x86 provides vcpu_postcreate right
now and it could only fail if vcpu_load failed.  But that is not
possible during KVM_CREATE_VCPU (kvm_arch_vcpu_load is void, too), so
just get rid of the unchecked return value.

Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
arch/arm/kvm/arm.c
arch/mips/kvm/mips.c
arch/powerpc/kvm/powerpc.c
arch/s390/kvm/kvm-s390.c
arch/x86/kvm/x86.c
include/linux/kvm_host.h

index 2d6d91001062f975981dd9beed2b43815f73c238..1a10e0ce9266972d68f63a790d52b280d75d83bd 100644 (file)
@@ -241,9 +241,8 @@ out:
        return ERR_PTR(err);
 }
 
-int kvm_arch_vcpu_postcreate(struct kvm_vcpu *vcpu)
+void kvm_arch_vcpu_postcreate(struct kvm_vcpu *vcpu)
 {
-       return 0;
 }
 
 void kvm_arch_vcpu_free(struct kvm_vcpu *vcpu)
index e3b21e51ff7e926ba00f4c4183c4ff146a26a775..7082481cd1087a205ace25ad31b1c0abb15e6400 100644 (file)
@@ -832,9 +832,8 @@ int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu,
        return -ENOIOCTLCMD;
 }
 
-int kvm_arch_vcpu_postcreate(struct kvm_vcpu *vcpu)
+void kvm_arch_vcpu_postcreate(struct kvm_vcpu *vcpu)
 {
-       return 0;
 }
 
 int kvm_arch_vcpu_ioctl_get_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu)
index c45eaab752b0d074f3b60689af861ccb75110269..27c0face86f45cdac10ac74ba309de04094a8367 100644 (file)
@@ -623,9 +623,8 @@ struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm, unsigned int id)
        return vcpu;
 }
 
-int kvm_arch_vcpu_postcreate(struct kvm_vcpu *vcpu)
+void kvm_arch_vcpu_postcreate(struct kvm_vcpu *vcpu)
 {
-       return 0;
 }
 
 void kvm_arch_vcpu_free(struct kvm_vcpu *vcpu)
index 3e09801e310461ff00e3975080eb9bd3b75de52f..ec004f80ee45a4b4ab29e57bfed8b5118ba7128e 100644 (file)
@@ -615,9 +615,8 @@ static void kvm_s390_vcpu_initial_reset(struct kvm_vcpu *vcpu)
        kvm_s390_clear_local_irqs(vcpu);
 }
 
-int kvm_arch_vcpu_postcreate(struct kvm_vcpu *vcpu)
+void kvm_arch_vcpu_postcreate(struct kvm_vcpu *vcpu)
 {
-       return 0;
 }
 
 static void kvm_s390_vcpu_crypto_setup(struct kvm_vcpu *vcpu)
index 49ecda7ca9581349fb1cdc8c7962632f61b14e15..274fbcbcc180fa5279bb60abea955da7e8283e64 100644 (file)
@@ -7056,15 +7056,13 @@ int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu)
        return r;
 }
 
-int kvm_arch_vcpu_postcreate(struct kvm_vcpu *vcpu)
+void kvm_arch_vcpu_postcreate(struct kvm_vcpu *vcpu)
 {
-       int r;
        struct msr_data msr;
        struct kvm *kvm = vcpu->kvm;
 
-       r = vcpu_load(vcpu);
-       if (r)
-               return r;
+       if (vcpu_load(vcpu))
+               return;
        msr.data = 0x0;
        msr.index = MSR_IA32_TSC;
        msr.host_initiated = true;
@@ -7073,8 +7071,6 @@ int kvm_arch_vcpu_postcreate(struct kvm_vcpu *vcpu)
 
        schedule_delayed_work(&kvm->arch.kvmclock_sync_work,
                                        KVMCLOCK_SYNC_PERIOD);
-
-       return r;
 }
 
 void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu)
index 26f106022c8869dc5609f06f10579fb4ca5c4596..a82432c710c9c05a562f77cb3f0efa1ea697359e 100644 (file)
@@ -652,7 +652,7 @@ void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu);
 void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu);
 struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm, unsigned int id);
 int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu);
-int kvm_arch_vcpu_postcreate(struct kvm_vcpu *vcpu);
+void kvm_arch_vcpu_postcreate(struct kvm_vcpu *vcpu);
 void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu);
 
 int kvm_arch_hardware_enable(void);