KVM: x86: use list_last_entry
To make the intention clearer, use list_last_entry instead of list_entry. Signed-off-by: Geliang Tang <geliangtang@163.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:

committed by
Paolo Bonzini

orang tua
652fc08dae
melakukan
d74c0e6b54
@@ -2354,8 +2354,8 @@ static bool prepare_zap_oldest_mmu_page(struct kvm *kvm,
|
||||
if (list_empty(&kvm->arch.active_mmu_pages))
|
||||
return false;
|
||||
|
||||
sp = list_entry(kvm->arch.active_mmu_pages.prev,
|
||||
struct kvm_mmu_page, link);
|
||||
sp = list_last_entry(&kvm->arch.active_mmu_pages,
|
||||
struct kvm_mmu_page, link);
|
||||
kvm_mmu_prepare_zap_page(kvm, sp, invalid_list);
|
||||
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user