summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kvm
diff options
context:
space:
mode:
authorDavid Hildenbrand <dahi@linux.vnet.ibm.com>2015-11-05 09:03:50 +0100
committerChristian Borntraeger <borntraeger@de.ibm.com>2015-11-30 12:47:04 +0100
commite09fefdeeb517ff653516dea8a882ce001e99237 (patch)
treeb9cdb7b637b93779ea96f05cfc56fdead30f9b25 /arch/powerpc/kvm
parentbb11c6c96544737aede6a2eb92e5c6bc8b46534b (diff)
downloadlinux-stable-e09fefdeeb517ff653516dea8a882ce001e99237.tar.gz
linux-stable-e09fefdeeb517ff653516dea8a882ce001e99237.tar.bz2
linux-stable-e09fefdeeb517ff653516dea8a882ce001e99237.zip
KVM: Use common function for VCPU lookup by id
Let's reuse the new common function for VPCU lookup by id. Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com> Reviewed-by: Dominik Dingel <dingel@linux.vnet.ibm.com> Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> [split out the new function into a separate patch]
Diffstat (limited to 'arch/powerpc/kvm')
-rw-r--r--arch/powerpc/kvm/book3s_hv.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
index 54b45b73195f..a29da44cdc6c 100644
--- a/arch/powerpc/kvm/book3s_hv.c
+++ b/arch/powerpc/kvm/book3s_hv.c
@@ -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;
}