From: Paolo Bonzini <pbonzini@redhat.com>
To: Geliang Tang <geliangtang@163.com>,
Gleb Natapov <gleb@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/4] KVM: use list_for_each_entry_safe
Date: Thu, 7 Jan 2016 11:07:07 +0100 [thread overview]
Message-ID: <568E38CB.3010604@redhat.com> (raw)
In-Reply-To: <fed1e9a871e183628202c7aa7085d71d3dda4136.1451648473.git.geliangtang@163.com>
On 01/01/2016 12:47, Geliang Tang wrote:
> Use list_for_each_entry_safe() instead of list_for_each_safe() to
> simplify the code.
>
> Signed-off-by: Geliang Tang <geliangtang@163.com>
> ---
> virt/kvm/kvm_main.c | 9 +++------
> 1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> index 484079e..5b6df4f 100644
> --- a/virt/kvm/kvm_main.c
> +++ b/virt/kvm/kvm_main.c
> @@ -630,13 +630,10 @@ void *kvm_kvzalloc(unsigned long size)
>
> static void kvm_destroy_devices(struct kvm *kvm)
> {
> - struct list_head *node, *tmp;
> + struct kvm_device *dev, *tmp;
>
> - list_for_each_safe(node, tmp, &kvm->devices) {
> - struct kvm_device *dev =
> - list_entry(node, struct kvm_device, vm_node);
> -
> - list_del(node);
> + list_for_each_entry_safe(dev, tmp, &kvm->devices, vm_node) {
> + list_del(&dev->vm_node);
> dev->ops->destroy(dev);
> }
> }
>
These patches will be considered for 4.6. Thanks!
Paolo
prev parent reply other threads:[~2016-01-07 10:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-01 11:47 [PATCH 1/4] KVM: use list_for_each_entry_safe Geliang Tang
2016-01-01 11:47 ` [PATCH 2/4] KVM: x86: use list_for_each_entry* Geliang Tang
2016-01-01 11:47 ` [PATCH 3/4] KVM: x86: use list_last_entry Geliang Tang
2016-01-01 11:47 ` [PATCH 4/4] KVM: async_pf: use list_first_entry Geliang Tang
2016-01-07 10:07 ` Paolo Bonzini [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=568E38CB.3010604@redhat.com \
--to=pbonzini@redhat.com \
--cc=geliangtang@163.com \
--cc=gleb@kernel.org \
--cc=hpa@zytor.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.