All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>
Cc: qemu-devel@nongnu.org, "Eduardo Habkost" <eduardo@habkost.net>,
	"Gonglei Arei" <arei.gonglei@huawei.com>,
	"Li Qiang" <liq3ea@163.com>, "Cao jin" <caoj.fnst@cn.fujitsu.com>,
	"Hu Tao" <hutao@cn.fujitsu.com>,
	qemu-block@nongnu.org, qemu-ppc@nongnu.org,
	"xiaoqiang zhao" <zxq_yx_007@163.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>
Subject: Re: [PATCH v2 9/9] qdev-monitor: Use qdev_get_parent_bus() in bus_print_dev()
Date: Mon, 13 Feb 2023 08:09:39 +0100	[thread overview]
Message-ID: <87fsbaxcr0.fsf@pond.sub.org> (raw)
In-Reply-To: <20230213070423.76428-10-philmd@linaro.org> ("Philippe Mathieu-Daudé"'s message of "Mon, 13 Feb 2023 08:04:23 +0100")

Philippe Mathieu-Daudé <philmd@linaro.org> writes:

> No need to pass 'dev' and 'dev->parent_bus' when we can
> retrieve 'parent_bus' with qdev_get_parent_bus().
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>  softmmu/qdev-monitor.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/softmmu/qdev-monitor.c b/softmmu/qdev-monitor.c
> index 820e7f52ad..12e4899f0d 100644
> --- a/softmmu/qdev-monitor.c
> +++ b/softmmu/qdev-monitor.c
> @@ -770,9 +770,9 @@ static void qdev_print_props(Monitor *mon, DeviceState *dev, Property *props,
>      }
>  }
>  
> -static void bus_print_dev(BusState *bus, Monitor *mon, DeviceState *dev, int indent)
> +static void bus_print_dev(Monitor *mon, DeviceState *dev, int indent)
>  {
> -    BusClass *bc = BUS_GET_CLASS(bus);
> +    BusClass *bc = BUS_GET_CLASS(qdev_get_parent_bus(dev));
>  
>      if (bc->print_dev) {
>          bc->print_dev(mon, dev, indent);
> @@ -811,7 +811,7 @@ static void qdev_print(Monitor *mon, DeviceState *dev, int indent)
>          qdev_print_props(mon, dev, DEVICE_CLASS(class)->props_, indent);
>          class = object_class_get_parent(class);
>      } while (class != object_class_by_name(TYPE_DEVICE));
> -    bus_print_dev(dev->parent_bus, mon, dev, indent);
> +    bus_print_dev(mon, dev, indent);
>      QLIST_FOREACH(child, &dev->child_bus, sibling) {
>          qbus_print(mon, child, indent);
>      }

Reviewed-by: Markus Armbruster <armbru@redhat.com>



  reply	other threads:[~2023-02-13  7:13 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-13  7:04 [PATCH v2 0/9] hw/qdev: Housekeeping around qdev_get_parent_bus() Philippe Mathieu-Daudé
2023-02-13  7:04 ` [PATCH v2 1/9] hw/qdev: Constify DeviceState* argument of qdev_get_parent_bus() Philippe Mathieu-Daudé
2023-02-13  7:04 ` [PATCH v2 2/9] hw/audio: Replace dev->parent_bus by qdev_get_parent_bus(dev) Philippe Mathieu-Daudé
2023-02-13  7:04 ` [PATCH v2 3/9] hw/block: " Philippe Mathieu-Daudé
2023-02-13  7:04 ` [PATCH v2 4/9] hw/net: " Philippe Mathieu-Daudé
2023-02-13 10:52   ` Michael S. Tsirkin
2023-02-13  7:04 ` [PATCH v2 5/9] hw/pci: " Philippe Mathieu-Daudé
2023-02-13 10:52   ` Michael S. Tsirkin
2023-02-13  7:04 ` [PATCH v2 6/9] hw/ppc: " Philippe Mathieu-Daudé
2023-02-13  7:32   ` Cédric Le Goater
2023-02-13  7:04 ` [PATCH v2 7/9] hw/usb: " Philippe Mathieu-Daudé
2023-02-13  7:04 ` [PATCH v2 8/9] hw: Use qdev_get_parent_bus() in qdev_get_own_fw_dev_path_from_handler() Philippe Mathieu-Daudé
2023-02-13  7:04 ` [PATCH v2 9/9] qdev-monitor: Use qdev_get_parent_bus() in bus_print_dev() Philippe Mathieu-Daudé
2023-02-13  7:09   ` Markus Armbruster [this message]
2023-02-13 10:53 ` [PATCH v2 0/9] hw/qdev: Housekeeping around qdev_get_parent_bus() Michael S. Tsirkin
2023-02-13 11:07   ` Philippe Mathieu-Daudé

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=87fsbaxcr0.fsf@pond.sub.org \
    --to=armbru@redhat.com \
    --cc=arei.gonglei@huawei.com \
    --cc=berrange@redhat.com \
    --cc=caoj.fnst@cn.fujitsu.com \
    --cc=eduardo@habkost.net \
    --cc=hutao@cn.fujitsu.com \
    --cc=liq3ea@163.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=zxq_yx_007@163.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.