aboutsummaryrefslogtreecommitdiff
path: root/hw/misc/macio/macio.c
diff options
context:
space:
mode:
authorBALATON Zoltan <balaton@eik.bme.hu>2023-01-18 01:32:32 +0100
committerMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2023-02-06 11:41:39 +0000
commitea361fc348a43f5e751351191d8fc09fadd310bf (patch)
tree3185235fce0dc4f87687f251bdf478c6a811532b /hw/misc/macio/macio.c
parent4db4847d83f11a33f08b75836d1116a1188121ca (diff)
hw/misc/macio: Avoid some QOM casts
At several places we already have the object pointer with the right type so we don't need to cast it back and forth. Avoiding these casts improves readability. Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu> Message-Id: <67b2d4700879c3b4cd574f1faa1a0d1950b3d0ee.1674001242.git.balaton@eik.bme.hu> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Diffstat (limited to 'hw/misc/macio/macio.c')
-rw-r--r--hw/misc/macio/macio.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c
index 08dbdd7fc0..0dfe372965 100644
--- a/hw/misc/macio/macio.c
+++ b/hw/misc/macio/macio.c
@@ -220,11 +220,11 @@ static void macio_oldworld_init(Object *obj)
DeviceState *dev;
int i;
- object_initialize_child(OBJECT(s), "pic", &os->pic, TYPE_HEATHROW);
+ object_initialize_child(obj, "pic", &os->pic, TYPE_HEATHROW);
- object_initialize_child(OBJECT(s), "cuda", &s->cuda, TYPE_CUDA);
+ object_initialize_child(obj, "cuda", &s->cuda, TYPE_CUDA);
- object_initialize_child(OBJECT(s), "nvram", &os->nvram, TYPE_MACIO_NVRAM);
+ object_initialize_child(obj, "nvram", &os->nvram, TYPE_MACIO_NVRAM);
dev = DEVICE(&os->nvram);
qdev_prop_set_uint32(dev, "size", MACIO_NVRAM_SIZE);
qdev_prop_set_uint32(dev, "it_shift", 4);
@@ -372,9 +372,9 @@ static void macio_newworld_init(Object *obj)
NewWorldMacIOState *ns = NEWWORLD_MACIO(obj);
int i;
- object_initialize_child(OBJECT(s), "pic", &ns->pic, TYPE_OPENPIC);
+ object_initialize_child(obj, "pic", &ns->pic, TYPE_OPENPIC);
- object_initialize_child(OBJECT(s), "gpio", &ns->gpio, TYPE_MACIO_GPIO);
+ object_initialize_child(obj, "gpio", &ns->gpio, TYPE_MACIO_GPIO);
for (i = 0; i < 2; i++) {
macio_init_ide(s, &ns->ide[i], i);
@@ -390,9 +390,9 @@ static void macio_instance_init(Object *obj)
qbus_init(&s->macio_bus, sizeof(s->macio_bus), TYPE_MACIO_BUS,
DEVICE(obj), "macio.0");
- object_initialize_child(OBJECT(s), "dbdma", &s->dbdma, TYPE_MAC_DBDMA);
+ object_initialize_child(obj, "dbdma", &s->dbdma, TYPE_MAC_DBDMA);
- object_initialize_child(OBJECT(s), "escc", &s->escc, TYPE_ESCC);
+ object_initialize_child(obj, "escc", &s->escc, TYPE_ESCC);
}
static const VMStateDescription vmstate_macio_oldworld = {