KVM: SVM: move nested_svm_intr main logic out of if-clause
authorJoerg Roedel <joerg.roedel@amd.com>
Fri, 7 Aug 2009 09:49:46 +0000 (11:49 +0200)
committerAvi Kivity <avi@redhat.com>
Thu, 10 Sep 2009 07:46:36 +0000 (10:46 +0300)
This patch removes one indentation level from nested_svm_intr and
makes the logic more readable.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/x86/kvm/svm.c

index a1cfa7d57ab90d6d67b7cd4dd23a6547b0e15693..144f2025799fa6924b72ffca69d413f0b6a92196 100644 (file)
@@ -1374,19 +1374,20 @@ static int nested_svm_check_exception(struct vcpu_svm *svm, unsigned nr,
 
 static inline int nested_svm_intr(struct vcpu_svm *svm)
 {
-       if (is_nested(svm)) {
-               if (!(svm->vcpu.arch.hflags & HF_VINTR_MASK))
-                       return 0;
+       if (!is_nested(svm))
+               return 0;
 
-               if (!(svm->vcpu.arch.hflags & HF_HIF_MASK))
-                       return 0;
+       if (!(svm->vcpu.arch.hflags & HF_VINTR_MASK))
+               return 0;
 
-               svm->vmcb->control.exit_code = SVM_EXIT_INTR;
+       if (!(svm->vcpu.arch.hflags & HF_HIF_MASK))
+               return 0;
 
-               if (nested_svm_exit_handled(svm)) {
-                       nsvm_printk("VMexit -> INTR\n");
-                       return 1;
-               }
+       svm->vmcb->control.exit_code = SVM_EXIT_INTR;
+
+       if (nested_svm_exit_handled(svm)) {
+               nsvm_printk("VMexit -> INTR\n");
+               return 1;
        }
 
        return 0;