q35: Use type-safe cast instead of direct access of parent dev

And remove variables if possible.

Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
[AF: Converted remaining access and renamed to parent_obj]
Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
Hu Tao
2013-07-23 00:37:34 +02:00
committed by Andreas Färber
parent a3560fbf01
commit ce88812f57
3 changed files with 33 additions and 24 deletions
+8 -2
View File
@@ -43,7 +43,10 @@
OBJECT_CHECK(MCHPCIState, (obj), TYPE_MCH_PCI_DEVICE)
typedef struct MCHPCIState {
PCIDevice d;
/*< private >*/
PCIDevice parent_obj;
/*< public >*/
MemoryRegion *ram_memory;
MemoryRegion *pci_address_space;
MemoryRegion *system_memory;
@@ -59,7 +62,10 @@ typedef struct MCHPCIState {
} MCHPCIState;
typedef struct Q35PCIHost {
PCIExpressHost host;
/*< private >*/
PCIExpressHost parent_obj;
/*< public >*/
MCHPCIState mch;
} Q35PCIHost;