[RFC PATCH v1 14/26] KVM: arm64: Refactor code around handling return from host to guest

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Make the code more consistent and easier to read.

No functional change intended.

Signed-off-by: Fuad Tabba <tabba@xxxxxxxxxx>
---
 arch/arm64/kvm/arm.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c
index ab7e02acb17d..0a6991ee9615 100644
--- a/arch/arm64/kvm/arm.c
+++ b/arch/arm64/kvm/arm.c
@@ -1085,17 +1085,14 @@ static int noinstr kvm_arm_vcpu_enter_exit(struct kvm_vcpu *vcpu)
 int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu)
 {
 	struct kvm_run *run = vcpu->run;
-	int ret;
+	int ret = 1;
 
-	if (run->exit_reason == KVM_EXIT_MMIO) {
+	if (run->exit_reason == KVM_EXIT_MMIO)
 		ret = kvm_handle_mmio_return(vcpu);
-		if (ret <= 0)
-			return ret;
-	} else if (run->exit_reason == KVM_EXIT_HYPERCALL) {
+	else if (run->exit_reason == KVM_EXIT_HYPERCALL)
 		ret = kvm_handle_hypercall_return(vcpu);
-		if (ret <= 0)
-			return ret;
-	}
+	if (ret <= 0)
+		return ret;
 
 	vcpu_load(vcpu);
 
@@ -1106,7 +1103,6 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu)
 
 	kvm_sigset_activate(vcpu);
 
-	ret = 1;
 	run->exit_reason = KVM_EXIT_UNKNOWN;
 	run->flags = 0;
 	while (ret > 0) {
-- 
2.44.0.rc1.240.g4c46232300-goog





[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux