qemu-e2k/hw
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
..
9pfs Clean up some calls to ignore Error objects the right way 2020-07-02 06:25:28 +02:00
acpi qdev: Drop qbus_set_hotplug_handler() parameter @errp 2020-07-02 06:25:29 +02:00
adc hw/adc/stm32f2xx_adc: Correct memory region size and access size 2020-06-05 17:23:09 +01:00
alpha sysbus: Convert to sysbus_realize() etc. with Coccinelle 2020-06-15 22:05:28 +02:00
arm qdev: Use returned bool to check for qdev_realize() etc. failure 2020-07-10 15:01:06 +02:00
audio audio: set default value for pcspk.iobase property 2020-07-06 17:01:11 +02:00
block qdev: Use returned bool to check for qdev_realize() etc. failure 2020-07-10 15:01:06 +02:00
char qdev: Use returned bool to check for qdev_realize() etc. failure 2020-07-10 15:01:06 +02:00
core qdev: Use returned bool to check for qdev_realize() etc. failure 2020-07-10 15:01:06 +02:00
cpu qdev: Use returned bool to check for qdev_realize() etc. failure 2020-07-10 15:01:06 +02:00
cris sysbus: Convert to sysbus_realize() etc. with Coccinelle 2020-06-15 22:05:28 +02:00
display qdev: Use returned bool to check for qdev_realize() etc. failure 2020-07-10 15:01:06 +02:00
dma hw: Fix error API violation around object_property_set_link() 2020-07-02 06:25:29 +02:00
gpio hw/gpio/zaurus.c: Use LOG_GUEST_ERROR for bad guest register accesses 2020-07-03 16:59:45 +01:00
hppa sysbus: Convert to sysbus_realize() etc. with Coccinelle 2020-06-15 22:05:28 +02:00
hyperv hyperv: vmbus: Remove the 2nd IRQ 2020-06-26 09:39:40 -04:00
i2c hw/i2c/core: Add i2c_try_create_slave() and i2c_realize_and_unref() 2020-06-26 14:30:28 +01:00
i386 trivial branch patches 20200707 2020-07-09 14:13:19 +01:00
ide qdev: Make qdev_prop_set_drive() match the other helpers 2020-06-23 16:07:07 +02:00
input adb: add ADB bus trace events 2020-06-26 10:13:52 +01:00
intc qdev: Use returned bool to check for qdev_realize() etc. failure 2020-07-10 15:01:06 +02:00
ipack
ipmi
isa qdev: Use returned bool to check for qdev_realize() etc. failure 2020-07-10 15:01:06 +02:00
lm32 sysbus: Convert to sysbus_realize() etc. with Coccinelle 2020-06-15 22:05:28 +02:00
m68k hw/m68k/mcf5206: Replace remaining hw_error()s by qemu_log_mask() 2020-07-06 09:32:47 +02:00
mem
microblaze qdev: Use returned bool to check for qdev_realize() etc. failure 2020-07-10 15:01:06 +02:00
mips qdev: Use returned bool to check for qdev_realize() etc. failure 2020-07-10 15:01:06 +02:00
misc qdev: Use returned bool to check for qdev_realize() etc. failure 2020-07-10 15:01:06 +02:00
moxie
net virtio,acpi: features, fixes, cleanups. 2020-07-07 17:37:44 +01:00
nios2 sysbus: Convert to sysbus_realize() etc. with Coccinelle 2020-06-15 22:05:28 +02:00
nubus
nvram hw/nvram/fw_cfg: Add the FW_CFG_DATA_GENERATOR interface 2020-07-03 18:16:01 +02:00
openrisc sysbus: Convert to sysbus_realize() etc. with Coccinelle 2020-06-15 22:05:28 +02:00
pci qdev: Drop qbus_set_hotplug_handler() parameter @errp 2020-07-02 06:25:29 +02:00
pci-bridge sysbus: Convert to sysbus_realize() etc. with Coccinelle 2020-06-15 22:05:28 +02:00
pci-host qdev: Use returned bool to check for qdev_realize() etc. failure 2020-07-10 15:01:06 +02:00
pcmcia sysbus: Convert to sysbus_realize() etc. with Coccinelle 2020-06-15 22:05:28 +02:00
ppc qdev: Use returned bool to check for qdev_realize() etc. failure 2020-07-10 15:01:06 +02:00
rdma
riscv qdev: Use returned bool to check for qdev_realize() etc. failure 2020-07-10 15:01:06 +02:00
rtc sysbus: Convert to sysbus_realize() etc. with Coccinelle 2020-06-15 22:05:28 +02:00
rx hw/rx: Add RX GDB simulator 2020-06-22 18:37:12 +02:00
s390x qdev: Use returned bool to check for qdev_realize() etc. failure 2020-07-10 15:01:06 +02:00
scsi qdev: Use returned bool to check for qdev_realize() etc. failure 2020-07-10 15:01:06 +02:00
sd qdev: Use returned bool to check for qdev_realize() etc. failure 2020-07-10 15:01:06 +02:00
semihosting semihosting: remove the pthread include which seems unused 2020-06-10 11:29:44 +02:00
sh4 hw/sh4: Extract timer definitions to 'hw/timer/tmu012.h' 2020-06-22 18:37:12 +02:00
smbios
sparc sysbus: Convert to sysbus_realize() etc. with Coccinelle 2020-06-15 22:05:28 +02:00
sparc64 fdc: Reject clash between -drive if=floppy and -global isa-fdc 2020-06-23 16:07:07 +02:00
ssi ssi: Add ssi_realize_and_unref() 2020-07-03 16:59:44 +01:00
timer hw/timer: RX62N compare match timer (CMT) 2020-06-22 18:37:12 +02:00
tpm tpm: Move backend code under the 'backends/' directory 2020-06-19 07:25:55 -04:00
tricore
unicore32 hw/unicore32/puv3: Use qemu_log_mask(ERROR) instead of debug printf() 2020-06-09 19:01:56 +02:00
usb qdev: Use returned bool to check for qdev_realize() etc. failure 2020-07-10 15:01:06 +02:00
vfio vfio: Convert to ram_block_discard_disable() 2020-07-02 05:54:59 -04:00
virtio qdev: Use returned bool to check for qdev_realize() etc. failure 2020-07-10 15:01:06 +02:00
watchdog hw/watchdog/cmsdk-apb-watchdog: Add trace event for lock status 2020-06-23 11:39:47 +01:00
xen qdev: Drop qbus_set_bus_hotplug_handler() parameter @errp 2020-07-02 06:25:29 +02:00
xenpv
xtensa qdev: Make qdev_prop_set_drive() match the other helpers 2020-06-23 16:07:07 +02:00
Kconfig hw/rx: RX62N microcontroller (MCU) 2020-06-22 18:37:12 +02:00
Makefile.objs vga: build qxl as module 2020-07-07 15:33:59 +02:00