qemu-patch-raspberry4/hw/pci-host
Markus Armbruster 118bfd76c9 qdev: Use returned bool to check for qdev_realize() etc. failure
Convert

    foo(..., &err);
    if (err) {
        ...
    }

to

    if (!foo(..., &err)) {
        ...
    }

for qdev_realize(), qdev_realize_and_unref(), qbus_realize() and their
wrappers isa_realize_and_unref(), pci_realize_and_unref(),
sysbus_realize(), sysbus_realize_and_unref(), usb_realize_and_unref().
Coccinelle script:

    @@
    identifier fun = {
        isa_realize_and_unref, pci_realize_and_unref, qbus_realize,
        qdev_realize, qdev_realize_and_unref, sysbus_realize,
        sysbus_realize_and_unref, usb_realize_and_unref
    };
    expression list args, args2;
    typedef Error;
    Error *err;
    @@
    -    fun(args, &err, args2);
    -    if (err)
    +    if (!fun(args, &err, args2))
         {
             ...
         }

Chokes on hw/arm/musicpal.c's lcd_refresh() with the unhelpful error
message "no position information".  Nothing to convert there; skipped.

Fails to convert hw/arm/armsse.c, because Coccinelle gets confused by
ARMSSE being used both as typedef and function-like macro there.
Converted manually.

A few line breaks tidied up manually.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
Message-Id: <20200707160613.848843-5-armbru@redhat.com>
2020-07-10 15:01:06 +02:00
..
bonito.c sysbus: Convert to sysbus_realize() etc. with Coccinelle 2020-06-15 22:05:28 +02:00
designware.c qom: Less verbose object_initialize_child() 2020-06-15 22:05:28 +02:00
gpex.c qom: Less verbose object_initialize_child() 2020-06-15 22:05:28 +02:00
grackle.c qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
i440fx.c sysbus: Convert to sysbus_realize() etc. with Coccinelle 2020-06-15 22:05:28 +02:00
Kconfig hw/pci-host/bonito: Map all the Bonito64 I/O range 2020-05-26 12:09:18 +02:00
Makefile.objs hw/pci-host: Use CONFIG_PCI_BONITO to select the Bonito North Bridge 2020-05-26 12:09:18 +02:00
pam.c qom/object: Move Object typedef to 'qemu/typedefs.h' 2020-06-10 12:09:36 -04:00
pnv_phb3.c qdev: Use returned bool to check for qdev_realize() etc. failure 2020-07-10 15:01:06 +02:00
pnv_phb3_msi.c qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
pnv_phb3_pbcq.c qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
pnv_phb4.c qdev: Use returned bool to check for qdev_realize() etc. failure 2020-07-10 15:01:06 +02:00
pnv_phb4_pec.c qdev: Use returned bool to check for qdev_realize() etc. failure 2020-07-10 15:01:06 +02:00
ppce500.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
prep.c qdev: Convert bus-less devices to qdev_realize() with Coccinelle 2020-06-15 22:06:04 +02:00
q35.c qom: Less verbose object_initialize_child() 2020-06-15 22:05:28 +02:00
sabre.c pci: Convert uses of pci_create() etc. with Coccinelle 2020-06-15 22:05:28 +02:00
trace-events trace-events: Shorten file names in comments 2019-03-22 16:18:07 +00:00
uninorth.c qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
versatile.c qdev: Convert uses of qdev_set_parent_bus() with Coccinelle 2020-06-15 22:05:08 +02:00
xen_igd_pt.c hw/pci-host/i440fx: Extract the IGD passthrough host bridge device 2019-12-18 02:34:12 +01:00
xilinx-pcie.c qom: Less verbose object_initialize_child() 2020-06-15 22:05:28 +02:00