summaryrefslogtreecommitdiffstats
path: root/virt
diff options
context:
space:
mode:
authorGeliang Tang <geliangtang@163.com>2016-01-01 19:47:15 +0800
committerPaolo Bonzini <pbonzini@redhat.com>2016-02-23 15:40:55 +0100
commit433da86023f866820e9bcd7f0889d944005d311c (patch)
tree96f31d4eeebf3bf37c6b3bda962975e865073abf /virt
parentd74c0e6b54c95ace01f05264a22aed99b565fabb (diff)
downloadlinux-433da86023f866820e9bcd7f0889d944005d311c.tar.gz
linux-433da86023f866820e9bcd7f0889d944005d311c.tar.bz2
linux-433da86023f866820e9bcd7f0889d944005d311c.zip
KVM: async_pf: use list_first_entry
To make the intention clearer, use list_first_entry instead of list_entry. Signed-off-by: Geliang Tang <geliangtang@163.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'virt')
-rw-r--r--virt/kvm/async_pf.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/virt/kvm/async_pf.c b/virt/kvm/async_pf.c
index 353159922456..c7e447c4296e 100644
--- a/virt/kvm/async_pf.c
+++ b/virt/kvm/async_pf.c
@@ -109,8 +109,8 @@ void kvm_clear_async_pf_completion_queue(struct kvm_vcpu *vcpu)
/* cancel outstanding work queue item */
while (!list_empty(&vcpu->async_pf.queue)) {
struct kvm_async_pf *work =
- list_entry(vcpu->async_pf.queue.next,
- typeof(*work), queue);
+ list_first_entry(&vcpu->async_pf.queue,
+ typeof(*work), queue);
list_del(&work->queue);
#ifdef CONFIG_KVM_ASYNC_PF_SYNC
@@ -127,8 +127,8 @@ void kvm_clear_async_pf_completion_queue(struct kvm_vcpu *vcpu)
spin_lock(&vcpu->async_pf.lock);
while (!list_empty(&vcpu->async_pf.done)) {
struct kvm_async_pf *work =
- list_entry(vcpu->async_pf.done.next,
- typeof(*work), link);
+ list_first_entry(&vcpu->async_pf.done,
+ typeof(*work), link);
list_del(&work->link);
kmem_cache_free(async_pf_cache, work);
}