All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony Liguori <aliguori@us.ibm.com>
To: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
Cc: stefanha@linux.vnet.ibm.com, armbru@redhat.com,
	qemu-devel@nongnu.org, zwu.kernel@gmail.com, ryanh@us.ibm.com,
	luowenj@cn.ibm.com
Subject: Re: [Qemu-devel] [PATCH] qdev: Remove some non-run codes in qdev_walk_children().
Date: Thu, 11 Aug 2011 14:40:38 -0500	[thread overview]
Message-ID: <4E443036.7010908@us.ibm.com> (raw)
In-Reply-To: <1312776932-15081-1-git-send-email-wuzhy@linux.vnet.ibm.com>

On 08/07/2011 11:15 PM, Zhi Yong Wu wrote:
> As you have known, qdev_reset_one() forever return a ZERO value to its caller, so some branches can not be forever covered in qdev_walk_children().
>
> I thought that the return value for dev->info->reset(dev) can be returned, but dev->info->reset(dev) is referring to a function with void type.
>
> Signed-off-by: Zhi Yong Wu<wuzhy@linux.vnet.ibm.com>

But the details of qdev_reset_one are irrelevant to 
qdev_walk_children().  There may be other functions that want to walk 
the tree and it's useful to be able to interrupt the tree transversal by 
returning a non-zero value.

Regards,

Anthony Liguori

> ---
>   hw/qdev.c |    5 +----
>   1 files changed, 1 insertions(+), 4 deletions(-)
>
> diff --git a/hw/qdev.c b/hw/qdev.c
> index 292b52f..cbc5e02 100644
> --- a/hw/qdev.c
> +++ b/hw/qdev.c
> @@ -513,10 +513,7 @@ int qdev_walk_children(DeviceState *dev, qdev_walkerfn *devfn,
>       int err;
>
>       if (devfn) {
> -        err = devfn(dev, opaque);
> -        if (err) {
> -            return err;
> -        }
> +        devfn(dev, opaque);
>       }
>
>       QLIST_FOREACH(bus,&dev->child_bus, sibling) {

  reply	other threads:[~2011-08-11 19:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-08  4:15 [Qemu-devel] [PATCH] qdev: Remove some non-run codes in qdev_walk_children() Zhi Yong Wu
2011-08-11 19:40 ` Anthony Liguori [this message]
2011-08-12  2:14   ` Zhi Yong Wu

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=4E443036.7010908@us.ibm.com \
    --to=aliguori@us.ibm.com \
    --cc=armbru@redhat.com \
    --cc=luowenj@cn.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=ryanh@us.ibm.com \
    --cc=stefanha@linux.vnet.ibm.com \
    --cc=wuzhy@linux.vnet.ibm.com \
    --cc=zwu.kernel@gmail.com \
    /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.