mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-12-11 16:00:50 -07:00
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>
|
||
|---|---|---|
| .. | ||
| allwinner-a10.c | ||
| allwinner-h3.c | ||
| armsse.c | ||
| armv7m.c | ||
| aspeed.c | ||
| aspeed_ast2600.c | ||
| aspeed_soc.c | ||
| bcm2835_peripherals.c | ||
| bcm2836.c | ||
| boot.c | ||
| collie.c | ||
| cubieboard.c | ||
| digic.c | ||
| digic_boards.c | ||
| exynos4_boards.c | ||
| exynos4210.c | ||
| fsl-imx6.c | ||
| fsl-imx6ul.c | ||
| fsl-imx7.c | ||
| fsl-imx25.c | ||
| fsl-imx31.c | ||
| gumstix.c | ||
| highbank.c | ||
| imx25_pdk.c | ||
| integratorcp.c | ||
| Kconfig | ||
| kzm.c | ||
| mainstone.c | ||
| Makefile.objs | ||
| mcimx6ul-evk.c | ||
| mcimx7d-sabre.c | ||
| microbit.c | ||
| mps2-tz.c | ||
| mps2.c | ||
| msf2-soc.c | ||
| msf2-som.c | ||
| musca.c | ||
| musicpal.c | ||
| netduino2.c | ||
| netduinoplus2.c | ||
| nrf51_soc.c | ||
| nseries.c | ||
| omap1.c | ||
| omap2.c | ||
| omap_sx1.c | ||
| orangepi.c | ||
| palm.c | ||
| pxa2xx.c | ||
| pxa2xx_gpio.c | ||
| pxa2xx_pic.c | ||
| raspi.c | ||
| realview.c | ||
| sabrelite.c | ||
| sbsa-ref.c | ||
| smmu-common.c | ||
| smmu-internal.h | ||
| smmuv3-internal.h | ||
| smmuv3.c | ||
| spitz.c | ||
| stellaris.c | ||
| stm32f205_soc.c | ||
| stm32f405_soc.c | ||
| strongarm.c | ||
| strongarm.h | ||
| sysbus-fdt.c | ||
| tosa.c | ||
| trace-events | ||
| versatilepb.c | ||
| vexpress.c | ||
| virt-acpi-build.c | ||
| virt.c | ||
| xilinx_zynq.c | ||
| xlnx-versal-virt.c | ||
| xlnx-versal.c | ||
| xlnx-zcu102.c | ||
| xlnx-zynqmp.c | ||
| z2.c | ||