diff options
author | Markus Armbruster <armbru@redhat.com> | 2020-06-10 07:32:30 +0200 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2020-06-15 22:05:28 +0200 |
commit | 8352a5b8ccdaeb3fc1b00550399abc375ae62d8b (patch) | |
tree | de9f2708db29129900f8c5a0688b7bf04f9106ee /hw/display/sm501.c | |
parent | b0d09949fe2e0d3ebe806356bf782894f5b8acc5 (diff) | |
download | qemu-8352a5b8ccdaeb3fc1b00550399abc375ae62d8b.zip qemu-8352a5b8ccdaeb3fc1b00550399abc375ae62d8b.tar.gz qemu-8352a5b8ccdaeb3fc1b00550399abc375ae62d8b.tar.bz2 |
sysbus: Tidy up sysbus_init_child_obj()'s @childsize arg, part 1
The callers of sysbus_init_child_obj() commonly pass either &child,
sizeof(child), or pchild, sizeof(*pchild). Tidy up the few that use
sizeof(child_type) instead, mostly to keep future commits simpler.
Coccinelle script:
@@
expression parent, propname, type;
type T;
T child;
@@
- sysbus_init_child_obj(parent, propname, &child, sizeof(T), type)
+ sysbus_init_child_obj(parent, propname, &child, sizeof(child), type)
@@
expression parent, propname, type;
type T;
T *child;
@@
- sysbus_init_child_obj(parent, propname, child, sizeof(T), type)
+ sysbus_init_child_obj(parent, propname, child, sizeof(*child), type)
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-42-armbru@redhat.com>
Diffstat (limited to 'hw/display/sm501.c')
-rw-r--r-- | hw/display/sm501.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/display/sm501.c b/hw/display/sm501.c index 3e62eca..ccdbce1 100644 --- a/hw/display/sm501.c +++ b/hw/display/sm501.c @@ -2023,7 +2023,7 @@ static void sm501_sysbus_init(Object *o) SM501SysBusState *sm501 = SYSBUS_SM501(o); SerialMM *smm = &sm501->serial; - sysbus_init_child_obj(o, "serial", smm, sizeof(SerialMM), TYPE_SERIAL_MM); + sysbus_init_child_obj(o, "serial", smm, sizeof(*smm), TYPE_SERIAL_MM); qdev_set_legacy_instance_id(DEVICE(smm), SM501_UART0, 2); qdev_prop_set_uint8(DEVICE(smm), "regshift", 2); qdev_prop_set_uint8(DEVICE(smm), "endianness", DEVICE_LITTLE_ENDIAN); |