sysbus: Tidy up sysbus_init_child_obj()'s @childsize arg, part 2
commitb45ad78889461fdf9aa98493a9b49612a8e79833
authorMarkus Armbruster <armbru@redhat.com>
Wed, 10 Jun 2020 05:32:32 +0000 (10 07:32 +0200)
committerMarkus Armbruster <armbru@redhat.com>
Mon, 15 Jun 2020 20:05:28 +0000 (15 22:05 +0200)
tree3fae582e628a3e9bb60672dbf1fafa0a97fbe944
parent287f43196d1008b1f85d7a33593789381dde2d4b
sysbus: Tidy up sysbus_init_child_obj()'s @childsize arg, part 2

The callers of sysbus_init_child_obj() commonly pass either &child,
sizeof(child), or pchild, sizeof(*pchild).  Tidy up the few that use
something else instead, mostly to keep future commits simpler.

Coccinelle script:

    @@
    expression parent, propname, type;
    expression child;
    type T;
    T proxy;
    @@
    (
         sysbus_init_child_obj(parent, propname, &child, sizeof(child), type)
    |
         sysbus_init_child_obj(parent, propname, child, sizeof(*child), type)
    |
    -    sysbus_init_child_obj(parent, propname, child, sizeof(proxy), type)
    +    sysbus_init_child_obj(parent, propname, child, sizeof(*child), type)
    )

This script is *unsound*: for each change we need to verify the
@childsize argument stays the same.  I did.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-44-armbru@redhat.com>
hw/arm/mps2-tz.c
hw/arm/musca.c