Replace calls to object_child_foreach() with object_child_foreach_recursive()
PATCH 1/1 Replace calls to object_child_foreach() with object_child_foreach_recursive()
Replace calls to object_child_foreach() with object_child_foreach_recursive() when applicable: nvdimm_device_list, nmi_monitor_handle, find_sysbus_device, pc_dimm_slot2bitmap, build_dimm_list.
Signed-off-by Ernest Esene <[email protected]>
--- hw/acpi/nvdimm.c | 5 +++-- hw/core/sysbus.c | 2 +- hw/mem/pc-dimm.c | 5 +++-- hw/virtio/virtio-balloon.c | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-)
hw/acpi/nvdimm.c +3 -2
@@ -41,7 +41,7 @@ static int nvdimm_device_list(Object *obj, void *opaque) *list =g_slist_append (*list,DEVICE (obj)); } -object_child_foreach (obj, nvdimm_device_list, opaque); +object_child_foreach_recursive (obj, nvdimm_device_list, opaque);return 0 ; }
@@ -56,7 +56,8 @@ static GSList *nvdimm_get_device_list(void) {GSList *list =NULL ; -object_child_foreach (qdev_get_machine (), nvdimm_device_list, &list); +object_child_foreach_recursive (qdev_get_machine (), + nvdimm_device_list, &list);return list; }
hw/core/sysbus.c +1 -1
@@ -43,7 +43,7 @@ static int find_sysbus_device(Object *obj, void *opaque)if (!sbdev) {/* Container, traverse it for children */ -return object_child_foreach (obj, find_sysbus_device, opaque); +return object_child_foreach_recursive (obj, find_sysbus_device, opaque); } find->func (sbdev, find->opaque);
hw/mem/pc-dimm.c +3 -2
@@ -84,7 +84,7 @@ static int pc_dimm_slot2bitmap(Object *obj, void *opaque) } } -object_child_foreach (obj, pc_dimm_slot2bitmap, opaque); +object_child_foreach_recursive (obj, pc_dimm_slot2bitmap, opaque);return 0 ; }
@@ -100,7 +100,8 @@ static int pc_dimm_get_free_slot(const int *hint, int max_slots, Error **errp) } bitmap =bitmap_new (max_slots); -object_child_foreach (qdev_get_machine (), pc_dimm_slot2bitmap, bitmap); +object_child_foreach_recursive (qdev_get_machine (), + pc_dimm_slot2bitmap, bitmap);/* check if requested slot is not occupied */ if (hint) {
hw/virtio/virtio-balloon.c +1 -1
@@ -591,7 +591,7 @@ static int build_dimm_list(Object *obj, void *opaque) } } -object_child_foreach (obj, build_dimm_list, opaque); +object_child_foreach_recursive (obj, build_dimm_list, opaque);return 0 ; }
Signature · 1 line
2.14.2