qemu-devel
[Top][All Lists]
Advanced

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

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


From: Philippe Mathieu-Daudé
Subject: [PATCH 4/4] qdev-monitor: Use qdev_get_parent_bus() in bus_print_dev()
Date: Sun, 12 Feb 2023 23:47:30 +0100

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




reply via email to

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