qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 4/4] qdev-monitor: Use qdev_get_parent_bus() in bus_print_dev


From: Richard Henderson
Subject: Re: [PATCH 4/4] qdev-monitor: Use qdev_get_parent_bus() in bus_print_dev()
Date: Mon, 13 Feb 2023 13:31:45 -1000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1

On 2/12/23 12:47, Philippe Mathieu-Daudé wrote:
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(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~


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);
      }




reply via email to

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