Commit 798e88b3 authored by Paolo Bonzini's avatar Paolo Bonzini

KVM: MMU: cleanup handle_abnormal_pfn

The goto and temporary variable are unnecessary, just use return
statements.
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 8f22372f
...@@ -2821,20 +2821,16 @@ static void transparent_hugepage_adjust(struct kvm_vcpu *vcpu, ...@@ -2821,20 +2821,16 @@ static void transparent_hugepage_adjust(struct kvm_vcpu *vcpu,
static bool handle_abnormal_pfn(struct kvm_vcpu *vcpu, gva_t gva, gfn_t gfn, static bool handle_abnormal_pfn(struct kvm_vcpu *vcpu, gva_t gva, gfn_t gfn,
kvm_pfn_t pfn, unsigned access, int *ret_val) kvm_pfn_t pfn, unsigned access, int *ret_val)
{ {
bool ret = true;
/* The pfn is invalid, report the error! */ /* The pfn is invalid, report the error! */
if (unlikely(is_error_pfn(pfn))) { if (unlikely(is_error_pfn(pfn))) {
*ret_val = kvm_handle_bad_page(vcpu, gfn, pfn); *ret_val = kvm_handle_bad_page(vcpu, gfn, pfn);
goto exit; return true;
} }
if (unlikely(is_noslot_pfn(pfn))) if (unlikely(is_noslot_pfn(pfn)))
vcpu_cache_mmio_info(vcpu, gva, gfn, access); vcpu_cache_mmio_info(vcpu, gva, gfn, access);
ret = false; return false;
exit:
return ret;
} }
static bool page_fault_can_be_fast(u32 error_code) static bool page_fault_can_be_fast(u32 error_code)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment