Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm
[cascardo/linux.git] / arch / powerpc / kvm / book3s_hv.c
index a7352b5..6b35269 100644 (file)
@@ -314,16 +314,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;
 }