Commit 433da860 authored by Geliang Tang's avatar Geliang Tang Committed by Paolo Bonzini

KVM: async_pf: use list_first_entry

To make the intention clearer, use list_first_entry instead of
list_entry.
Signed-off-by: default avatarGeliang Tang <geliangtang@163.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent d74c0e6b
...@@ -109,7 +109,7 @@ void kvm_clear_async_pf_completion_queue(struct kvm_vcpu *vcpu) ...@@ -109,7 +109,7 @@ void kvm_clear_async_pf_completion_queue(struct kvm_vcpu *vcpu)
/* cancel outstanding work queue item */ /* cancel outstanding work queue item */
while (!list_empty(&vcpu->async_pf.queue)) { while (!list_empty(&vcpu->async_pf.queue)) {
struct kvm_async_pf *work = struct kvm_async_pf *work =
list_entry(vcpu->async_pf.queue.next, list_first_entry(&vcpu->async_pf.queue,
typeof(*work), queue); typeof(*work), queue);
list_del(&work->queue); list_del(&work->queue);
...@@ -127,7 +127,7 @@ void kvm_clear_async_pf_completion_queue(struct kvm_vcpu *vcpu) ...@@ -127,7 +127,7 @@ void kvm_clear_async_pf_completion_queue(struct kvm_vcpu *vcpu)
spin_lock(&vcpu->async_pf.lock); spin_lock(&vcpu->async_pf.lock);
while (!list_empty(&vcpu->async_pf.done)) { while (!list_empty(&vcpu->async_pf.done)) {
struct kvm_async_pf *work = struct kvm_async_pf *work =
list_entry(vcpu->async_pf.done.next, list_first_entry(&vcpu->async_pf.done,
typeof(*work), link); typeof(*work), link);
list_del(&work->link); list_del(&work->link);
kmem_cache_free(async_pf_cache, work); kmem_cache_free(async_pf_cache, work);
......
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