KVM: s390: Allow NULL parameter for kvm_s390_get_regs_rre
authorThomas Huth <thuth@linux.vnet.ibm.com>
Thu, 12 Sep 2013 08:33:46 +0000 (10:33 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 24 Sep 2013 17:12:20 +0000 (19:12 +0200)
We're not always interested in both registers that are specified
for an RRE instruction. So allow NULL as parameter, too, to indicate
that we do not need the corresponding value.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/s390/kvm/kvm-s390.h

index a307a854a8d490c1b6a1d1b2b1fea3d62d75668f..b44912a3294941b8df9e9ca27d140ce52149408d 100644 (file)
@@ -90,8 +90,10 @@ static inline void kvm_s390_get_base_disp_sse(struct kvm_vcpu *vcpu,
 
 static inline void kvm_s390_get_regs_rre(struct kvm_vcpu *vcpu, int *r1, int *r2)
 {
-       *r1 = (vcpu->arch.sie_block->ipb & 0x00f00000) >> 20;
-       *r2 = (vcpu->arch.sie_block->ipb & 0x000f0000) >> 16;
+       if (r1)
+               *r1 = (vcpu->arch.sie_block->ipb & 0x00f00000) >> 20;
+       if (r2)
+               *r2 = (vcpu->arch.sie_block->ipb & 0x000f0000) >> 16;
 }
 
 static inline u64 kvm_s390_get_base_disp_rsy(struct kvm_vcpu *vcpu)
This page took 0.026689 seconds and 5 git commands to generate.