]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - arch/powerpc/kvm/book3s_hv.c
KVM: Use common function for VCPU lookup by id
[karo-tx-linux.git] / arch / powerpc / kvm / book3s_hv.c
index 54b45b73195f912688ec4afe8e9fb4c9c3d5723c..a29da44cdc6cb3e88eaacd70d01b38b68eb51eef 100644 (file)
@@ -308,16 +308,10 @@ static void kvmppc_dump_regs(struct kvm_vcpu *vcpu)
 
 static struct kvm_vcpu *kvmppc_find_vcpu(struct kvm *kvm, int id)
 {
-       int r;
-       struct kvm_vcpu *v, *ret = NULL;
+       struct kvm_vcpu *ret;
 
        mutex_lock(&kvm->lock);
-       kvm_for_each_vcpu(r, v, kvm) {
-               if (v->vcpu_id == id) {
-                       ret = v;
-                       break;
-               }
-       }
+       ret = kvm_get_vcpu_by_id(kvm, id);
        mutex_unlock(&kvm->lock);
        return ret;
 }