qemu-patch-raspberry4/hw/usb
Markus Armbruster 62a35aaa31 qapi: Use returned bool to check for failure, Coccinelle part
The previous commit enables conversion of

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

to

    if (!visit_foo(..., errp)) {
        ...
    }

for visitor functions that now return true / false on success / error.
Coccinelle script:

    @@
    identifier fun =~ "check_list|input_type_enum|lv_start_struct|lv_type_bool|lv_type_int64|lv_type_str|lv_type_uint64|output_type_enum|parse_type_bool|parse_type_int64|parse_type_null|parse_type_number|parse_type_size|parse_type_str|parse_type_uint64|print_type_bool|print_type_int64|print_type_null|print_type_number|print_type_size|print_type_str|print_type_uint64|qapi_clone_start_alternate|qapi_clone_start_list|qapi_clone_start_struct|qapi_clone_type_bool|qapi_clone_type_int64|qapi_clone_type_null|qapi_clone_type_number|qapi_clone_type_str|qapi_clone_type_uint64|qapi_dealloc_start_list|qapi_dealloc_start_struct|qapi_dealloc_type_anything|qapi_dealloc_type_bool|qapi_dealloc_type_int64|qapi_dealloc_type_null|qapi_dealloc_type_number|qapi_dealloc_type_str|qapi_dealloc_type_uint64|qobject_input_check_list|qobject_input_check_struct|qobject_input_start_alternate|qobject_input_start_list|qobject_input_start_struct|qobject_input_type_any|qobject_input_type_bool|qobject_input_type_bool_keyval|qobject_input_type_int64|qobject_input_type_int64_keyval|qobject_input_type_null|qobject_input_type_number|qobject_input_type_number_keyval|qobject_input_type_size_keyval|qobject_input_type_str|qobject_input_type_str_keyval|qobject_input_type_uint64|qobject_input_type_uint64_keyval|qobject_output_start_list|qobject_output_start_struct|qobject_output_type_any|qobject_output_type_bool|qobject_output_type_int64|qobject_output_type_null|qobject_output_type_number|qobject_output_type_str|qobject_output_type_uint64|start_list|visit_check_list|visit_check_struct|visit_start_alternate|visit_start_list|visit_start_struct|visit_type_.*";
    expression list args;
    typedef Error;
    Error *err;
    @@
    -    fun(args, &err);
    -    if (err)
    +    if (!fun(args, &err))
         {
             ...
         }

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>
Message-Id: <20200707160613.848843-19-armbru@redhat.com>
2020-07-10 15:18:08 +02:00
..
bus.c qdev: Use returned bool to check for qdev_realize() etc. failure 2020-07-10 15:01:06 +02:00
ccid-card-emulated.c qdev: Unrealize must not fail 2020-05-15 07:08:14 +02:00
ccid-card-passthru.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
ccid.h qdev: Unrealize must not fail 2020-05-15 07:08:14 +02:00
chipidea.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
combined-packet.c Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
core.c Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
desc-msos.c usb: use local path for local headers 2018-06-01 19:20:38 +03:00
desc.c usb: use local path for local headers 2018-06-01 19:20:38 +03:00
desc.h all: Clean up includes 2016-02-23 12:43:05 +00:00
dev-audio.c qdev: Unrealize must not fail 2020-05-15 07:08:14 +02:00
dev-hid.c qdev: Unrealize must not fail 2020-05-15 07:08:14 +02:00
dev-hub.c qdev: Unrealize must not fail 2020-05-15 07:08:14 +02:00
dev-mtp.c usb/dev-mtp: Fix Error double free after inotify failure 2020-07-02 06:25:28 +02:00
dev-network.c qdev: Unrealize must not fail 2020-05-15 07:08:14 +02:00
dev-serial.c usb: Convert uses of usb_create() 2020-06-15 22:05:28 +02:00
dev-smartcard-reader.c qdev: Drop qbus_set_hotplug_handler() parameter @errp 2020-07-02 06:25:29 +02:00
dev-storage.c qapi: Use returned bool to check for failure, Coccinelle part 2020-07-10 15:18:08 +02:00
dev-uas.c qdev: Unrealize must not fail 2020-05-15 07:08:14 +02:00
dev-wacom.c qdev: Unrealize must not fail 2020-05-15 07:08:14 +02:00
hcd-dwc2.c dwc-hsotg (dwc2) USB host controller emulation 2020-06-05 17:23:09 +01:00
hcd-dwc2.h dwc-hsotg (dwc2) USB host controller state definitions 2020-06-05 17:23:09 +01:00
hcd-ehci-pci.c qdev: Unrealize must not fail 2020-05-15 07:08:14 +02:00
hcd-ehci-sysbus.c hw/arm/allwinner-h3: add USB host controller 2020-03-12 16:27:33 +00:00
hcd-ehci.c qdev: Unrealize must not fail 2020-05-15 07:08:14 +02:00
hcd-ehci.h qdev: Unrealize must not fail 2020-05-15 07:08:14 +02:00
hcd-musb.c exec/cpu-common: Move MUSB specific typedefs to 'hw/usb/hcd-musb.h' 2020-06-12 11:20:15 -04:00
hcd-ohci-pci.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
hcd-ohci.c hw: usb: hcd-ohci: Move OHCISysBusState and TYPE_SYSBUS_OHCI to include file 2020-02-21 16:07:02 +00:00
hcd-ohci.h hw: usb: hcd-ohci: Move OHCISysBusState and TYPE_SYSBUS_OHCI to include file 2020-02-21 16:07:02 +00:00
hcd-uhci.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
hcd-xhci-nec.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
hcd-xhci.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
hcd-xhci.h osdep: Make MIN/MAX evaluate arguments only once 2020-06-26 09:39:39 -04:00
host-libusb.c usb-host: workaround libusb bug 2020-06-17 09:12:33 +02:00
host-stub.c Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
host.h usb-host: move legacy cmd line bits 2013-02-19 12:30:05 +01:00
imx-usb-phy.c hw/usb: Add basic i.MX USB Phy support 2020-03-17 11:23:14 +00:00
Kconfig dwc-hsotg (dwc2) USB host controller emulation 2020-06-05 17:23:09 +01:00
libhw.c Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
Makefile.objs usb: build usb-redir as module 2020-07-07 15:33:59 +02:00
quirks-ftdi-ids.h usbredir: Add support for buffered bulk input (v2) 2013-01-08 10:56:58 +01:00
quirks-pl2303-ids.h usbredir: Add support for buffered bulk input (v2) 2013-01-08 10:56:58 +01:00
quirks.c hw/usb/quirks: Use smaller types to reduce .rodata by 10KiB 2020-03-16 23:02:25 +01:00
quirks.h hw/usb/quirks: Use smaller types to reduce .rodata by 10KiB 2020-03-16 23:02:25 +01:00
redirect.c qdev: Unrealize must not fail 2020-05-15 07:08:14 +02:00
trace-events usb: add hostdevice property to usb-host 2020-06-17 09:12:22 +02:00
tusb6010.c hw/usb: Move device-specific declarations to new 'hcd-musb.h' header 2020-06-12 11:20:14 -04:00
xen-usb.c xen: Fix and improve handling of device_add usb-host errors 2020-05-27 07:45:17 +02:00