Skip to contentSkip to conversation

isa: QOM'ify isa_bus_from_device()

PATCH In review Andreas Färber 1 participant 3 messages Jan 20, 2013 – Feb 1, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 isa: QOM'ify isa_bus_from_device()

DeviceState::parent_bus is document as private and should be accessed through qdev_get_parent_bus(). Use a DEVICE() cast instead of accessing ISADevice's qdev field directly. Use ISA_BUS() in place of DO_UPCAST().

---
 hw/isa.h |    2 +-

1 Datei geändert, 1 Zeile hinzugefügt(+), 1 Zeile entfernt(-)

hw/isa.h +1 -1
index 62e89d3..7a8874a 100644
@@ -82,7 +82,7 @@ void isa_register_portio_list(ISADevice *dev, uint16_t start,
 
 static inline ISABus *isa_bus_from_device(ISADevice *d)
 {
-    return DO_UPCAST(ISABus, qbus, d->qdev.parent_bus);
+    return ISA_BUS(qdev_get_parent_bus(DEVICE(d)));
 }
 
 extern hwaddr isa_mem_base;
Signature · 1 line
1.7.10.4
#1 lore raw

Am 20.01.2013 18:56, schrieb Andreas Färber:

Quoted 1 line

DeviceState::parent_bus is document as private and should be accessed

"documented" - please fix when applying.

Quoted 22 lines

through qdev_get_parent_bus(). Use a DEVICE() cast instead of accessing ISADevice's qdev field directly. Use ISA_BUS() in place of DO_UPCAST().

---
 hw/isa.h |    2 +-

1 Datei geändert, 1 Zeile hinzugefügt(+), 1 Zeile entfernt(-)

hw/isa.h +1 -1
index 62e89d3..7a8874a 100644
@@ -82,7 +82,7 @@ void isa_register_portio_list(ISADevice *dev, uint16_t start,
 
 static inline ISABus *isa_bus_from_device(ISADevice *d)
 {
-    return DO_UPCAST(ISABus, qbus, d->qdev.parent_bus);
+    return ISA_BUS(qdev_get_parent_bus(DEVICE(d)));
 }
 
 extern hwaddr isa_mem_base;
Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
#2 lore raw

Am 20.01.2013 19:16, schrieb Andreas Färber:

Quoted 13 lines

Am 20.01.2013 18:56, schrieb Andreas Färber:

Quoted 1 line

DeviceState::parent_bus is document as private and should be accessed

"documented" - please fix when applying.

Quoted 8 lines

through qdev_get_parent_bus(). Use a DEVICE() cast instead of accessing ISADevice's qdev field directly. Use ISA_BUS() in place of DO_UPCAST().

---
 hw/isa.h |    2 +-

1 Datei geändert, 1 Zeile hinzugefügt(+), 1 Zeile entfernt(-)

Ping? Not 1.4 material or an oversight? Should I resend due to typo?

Andreas

Quoted 13 lines
Quoted 13 lines
hw/isa.h +1 -1
index 62e89d3..7a8874a 100644
@@ -82,7 +82,7 @@ void isa_register_portio_list(ISADevice *dev, uint16_t start,
 
 static inline ISABus *isa_bus_from_device(ISADevice *d)
 {
-    return DO_UPCAST(ISABus, qbus, d->qdev.parent_bus);
+    return ISA_BUS(qdev_get_parent_bus(DEVICE(d)));
 }
 
 extern hwaddr isa_mem_base;
Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg