KVM: MMU: cleanup for function unaccount_shadowed()
PATCH 1/1 KVM: MMU: cleanup for function unaccount_shadowed()
Since gfn is not changed in the for loop, we do not need to call gfn_to_memslot_unaliased() under the loop, and it is safe to move it out.
Signed-off-by Wei Yongjun <[email protected]>
--- arch/x86/kvm/mmu.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/x86/kvm/mmu.c +1 -1
@@ -430,9 +430,9 @@ static void unaccount_shadowed(struct kvm *kvm, gfn_t gfn)int i; gfn =unalias_gfn (kvm, gfn); + slot =gfn_to_memslot_unaliased (kvm, gfn);for (i =PT_DIRECTORY_LEVEL ; i <PT_PAGE_TABLE_LEVEL +KVM_NR_PAGE_SIZES ; ++i) { - slot =gfn_to_memslot_unaliased (kvm, gfn); write_count =slot_largepage_idx (gfn, slot, i); *write_count -=1 ;WARN_ON (*write_count <0 );
Signature · 1 line
1.7.0
Avi Kivity
AppliedQuoted 4 lines · Wei Yongjun
Since gfn is not changed in the for loop, we do not need to call
gfn_to_memslot_unaliased()under the loop, and it is safe to move it out.
Applied, thanks.
Signature · 1 line
error compiling committee.c: too many arguments to function