KVM: MMU: Eliminate eperm temporary
authorAvi Kivity <avi@redhat.com>
Sun, 16 Sep 2012 11:49:15 +0000 (14:49 +0300)
committerAvi Kivity <avi@redhat.com>
Thu, 20 Sep 2012 10:00:09 +0000 (13:00 +0300)
'eperm' is no longer used in the walker loop, so we can eliminate it.

Reviewed-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/x86/kvm/paging_tmpl.h

index 134ea7b1c585a2876469c610cc661ed4be27b063..95a64d1dccc795c4f6d2ef5e62d127d70c809eed 100644 (file)
@@ -153,7 +153,6 @@ static int FNAME(walk_addr_generic)(struct guest_walker *walker,
        gfn_t table_gfn;
        unsigned index, pt_access, pte_access;
        gpa_t pte_gpa;
-       bool eperm;
        int offset;
        const int write_fault = access & PFERR_WRITE_MASK;
        const int user_fault  = access & PFERR_USER_MASK;
@@ -165,7 +164,6 @@ static int FNAME(walk_addr_generic)(struct guest_walker *walker,
 
        trace_kvm_mmu_pagetable_walk(addr, access);
 retry_walk:
-       eperm = false;
        walker->level = mmu->root_level;
        pte           = mmu->get_cr3(vcpu);
 
@@ -231,8 +229,7 @@ retry_walk:
                walker->ptes[walker->level - 1] = pte;
        } while (!is_last_gpte(mmu, walker->level, pte));
 
-       eperm |= permission_fault(mmu, pte_access, access);
-       if (unlikely(eperm)) {
+       if (unlikely(permission_fault(mmu, pte_access, access))) {
                errcode |= PFERR_PRESENT_MASK;
                goto error;
        }