qemu/hw/char
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
..
bcm2835_aux.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
cadence_uart.c hw/char/cadence_uart: add clock support 2020-04-30 15:35:41 +01:00
cmsdk-apb-uart.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
debugcon.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
digic-uart.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
escc.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
etraxfs_ser.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
exynos4210_uart.c sysbus: Convert to sysbus_realize() etc. with Coccinelle 2020-06-15 22:05:28 +02:00
grlib_apbuart.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
ibex_uart.c ibex_uart: fix XOR-as-pow 2020-06-26 09:39:40 -04:00
imx_serial.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
ipoctal232.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
Kconfig hw/char: RX62N serial communication interface (SCI) 2020-06-22 18:37:12 +02:00
lm32_juart.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
lm32_uart.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
Makefile.objs hw/char: RX62N serial communication interface (SCI) 2020-06-22 18:37:12 +02:00
mcf_uart.c sysbus: Convert to sysbus_realize() etc. with Coccinelle 2020-06-15 22:05:28 +02:00
milkymist-uart.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
nrf51_uart.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
omap_uart.c serial: start making SerialMM a sysbus device 2020-01-07 17:23:30 +04:00
parallel-isa.c isa: Convert uses of isa_create() with Coccinelle 2020-06-15 22:05:28 +02:00
parallel.c acpi: move aml builder code for parallel device 2020-06-09 12:46:45 -04:00
pl011.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
renesas_sci.c hw/char: RX62N serial communication interface (SCI) 2020-06-22 18:37:12 +02:00
sclpconsole-lm.c misc: Replace zero-length arrays with flexible array member (manual) 2020-03-16 22:07:42 +01:00
sclpconsole.c misc: Replace zero-length arrays with flexible array member (manual) 2020-03-16 22:07:42 +01:00
serial-isa.c qdev: Convert bus-less devices to qdev_realize() with Coccinelle 2020-06-15 22:06:04 +02:00
serial-pci-multi.c qdev: Use returned bool to check for qdev_realize() etc. failure 2020-07-10 15:01:06 +02:00
serial-pci.c qdev: Use returned bool to check for qdev_realize() etc. failure 2020-07-10 15:01:06 +02:00
serial.c qdev: Use returned bool to check for qdev_realize() etc. failure 2020-07-10 15:01:06 +02:00
sh_serial.c chardev: Use QEMUChrEvent enum in IOEventHandler typedef 2020-01-08 11:15:35 +01:00
spapr_vty.c qdev: Convert uses of qdev_create() with Coccinelle 2020-06-15 22:00:10 +02:00
stm32f2xx_usart.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
terminal3270.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
trace-events hw/char/cadence_uart: add clock support 2020-04-30 15:35:41 +01:00
virtio-console.c qdev: Unrealize must not fail 2020-05-15 07:08:14 +02:00
virtio-serial-bus.c qdev: Drop qbus_set_hotplug_handler() parameter @errp 2020-07-02 06:25:29 +02:00
xen_console.c Include sysemu/sysemu.h a lot less 2019-08-16 13:31:53 +02:00
xilinx_uartlite.c hw/char/xilinx_uartlite: Replace hw_error() by qemu_log_mask() 2020-05-21 22:05:27 +01:00