qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 9/9] qdev-monitor: Use qdev_get_parent_bus() in bus_print_


From: Markus Armbruster
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
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)

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 via email to

[Prev in Thread] Current Thread [Next in Thread]