diff options
author | Eduardo Habkost <ehabkost@redhat.com> | 2020-09-16 14:25:19 -0400 |
---|---|---|
committer | Eduardo Habkost <ehabkost@redhat.com> | 2020-09-18 14:12:32 -0400 |
commit | 8063396bf3459a810d24e3efd6110b8480f0de5b (patch) | |
tree | 40f85f15d7016e3ee66916a59be53d2b2c71510a /hw/usb | |
parent | a489d1951cd9cc91c5954214fcf6ae0f9d2d4292 (diff) |
Use OBJECT_DECLARE_SIMPLE_TYPE when possible
This converts existing DECLARE_INSTANCE_CHECKER usage to
OBJECT_DECLARE_SIMPLE_TYPE when possible.
$ ./scripts/codeconverter/converter.py -i \
--pattern=AddObjectDeclareSimpleType $(git grep -l '' -- '*.[ch]')
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Acked-by: Paul Durrant <paul@xen.org>
Message-Id: <20200916182519.415636-6-ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'hw/usb')
-rw-r--r-- | hw/usb/dev-audio.c | 4 | ||||
-rw-r--r-- | hw/usb/dev-hid.c | 4 | ||||
-rw-r--r-- | hw/usb/dev-hub.c | 4 | ||||
-rw-r--r-- | hw/usb/dev-mtp.c | 3 | ||||
-rw-r--r-- | hw/usb/dev-network.c | 4 | ||||
-rw-r--r-- | hw/usb/dev-serial.c | 4 | ||||
-rw-r--r-- | hw/usb/dev-smartcard-reader.c | 7 | ||||
-rw-r--r-- | hw/usb/dev-uas.c | 3 | ||||
-rw-r--r-- | hw/usb/dev-wacom.c | 4 | ||||
-rw-r--r-- | hw/usb/hcd-ehci.h | 8 | ||||
-rw-r--r-- | hw/usb/hcd-ohci-pci.c | 4 | ||||
-rw-r--r-- | hw/usb/hcd-ohci.h | 4 | ||||
-rw-r--r-- | hw/usb/hcd-xhci.h | 4 | ||||
-rw-r--r-- | hw/usb/host-libusb.c | 4 | ||||
-rw-r--r-- | hw/usb/tusb6010.c | 4 |
15 files changed, 17 insertions, 48 deletions
diff --git a/hw/usb/dev-audio.c b/hw/usb/dev-audio.c index 65247ca799..e1486f81e0 100644 --- a/hw/usb/dev-audio.c +++ b/hw/usb/dev-audio.c @@ -654,11 +654,9 @@ struct USBAudioState { uint32_t buffer_user, buffer; bool multi; }; -typedef struct USBAudioState USBAudioState; #define TYPE_USB_AUDIO "usb-audio" -DECLARE_INSTANCE_CHECKER(USBAudioState, USB_AUDIO, - TYPE_USB_AUDIO) +OBJECT_DECLARE_SIMPLE_TYPE(USBAudioState, USB_AUDIO) static void output_callback(void *opaque, int avail) { diff --git a/hw/usb/dev-hid.c b/hw/usb/dev-hid.c index 05cfe6baca..fc39bab79f 100644 --- a/hw/usb/dev-hid.c +++ b/hw/usb/dev-hid.c @@ -44,11 +44,9 @@ struct USBHIDState { char *display; uint32_t head; }; -typedef struct USBHIDState USBHIDState; #define TYPE_USB_HID "usb-hid" -DECLARE_INSTANCE_CHECKER(USBHIDState, USB_HID, - TYPE_USB_HID) +OBJECT_DECLARE_SIMPLE_TYPE(USBHIDState, USB_HID) enum { STR_MANUFACTURER = 1, diff --git a/hw/usb/dev-hub.c b/hw/usb/dev-hub.c index 7a182f9bec..40c1f90694 100644 --- a/hw/usb/dev-hub.c +++ b/hw/usb/dev-hub.c @@ -50,11 +50,9 @@ struct USBHubState { QEMUTimer *port_timer; USBHubPort ports[MAX_PORTS]; }; -typedef struct USBHubState USBHubState; #define TYPE_USB_HUB "usb-hub" -DECLARE_INSTANCE_CHECKER(USBHubState, USB_HUB, - TYPE_USB_HUB) +OBJECT_DECLARE_SIMPLE_TYPE(USBHubState, USB_HUB) #define ClearHubFeature (0x2000 | USB_REQ_CLEAR_FEATURE) #define ClearPortFeature (0x2300 | USB_REQ_CLEAR_FEATURE) diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c index c61c0e0878..bbb8274344 100644 --- a/hw/usb/dev-mtp.c +++ b/hw/usb/dev-mtp.c @@ -238,8 +238,7 @@ typedef struct { } QEMU_PACKED ObjectInfo; #define TYPE_USB_MTP "usb-mtp" -DECLARE_INSTANCE_CHECKER(MTPState, USB_MTP, - TYPE_USB_MTP) +OBJECT_DECLARE_SIMPLE_TYPE(MTPState, USB_MTP) #define QEMU_STORAGE_ID 0x00010001 diff --git a/hw/usb/dev-network.c b/hw/usb/dev-network.c index cd32f57685..6c49c16015 100644 --- a/hw/usb/dev-network.c +++ b/hw/usb/dev-network.c @@ -653,11 +653,9 @@ struct USBNetState { NICConf conf; QTAILQ_HEAD(, rndis_response) rndis_resp; }; -typedef struct USBNetState USBNetState; #define TYPE_USB_NET "usb-net" -DECLARE_INSTANCE_CHECKER(USBNetState, USB_NET, - TYPE_USB_NET) +OBJECT_DECLARE_SIMPLE_TYPE(USBNetState, USB_NET) static int is_rndis(USBNetState *s) { diff --git a/hw/usb/dev-serial.c b/hw/usb/dev-serial.c index 1a038a222e..b1622b7c7f 100644 --- a/hw/usb/dev-serial.c +++ b/hw/usb/dev-serial.c @@ -110,11 +110,9 @@ struct USBSerialState { int latency; /* ms */ CharBackend cs; }; -typedef struct USBSerialState USBSerialState; #define TYPE_USB_SERIAL "usb-serial-dev" -DECLARE_INSTANCE_CHECKER(USBSerialState, USB_SERIAL, - TYPE_USB_SERIAL) +OBJECT_DECLARE_SIMPLE_TYPE(USBSerialState, USB_SERIAL) enum { STR_MANUFACTURER = 1, diff --git a/hw/usb/dev-smartcard-reader.c b/hw/usb/dev-smartcard-reader.c index 59b2248f34..946df9734a 100644 --- a/hw/usb/dev-smartcard-reader.c +++ b/hw/usb/dev-smartcard-reader.c @@ -61,9 +61,7 @@ do { \ #define D_VERBOSE 4 #define TYPE_USB_CCID_DEV "usb-ccid" -typedef struct USBCCIDState USBCCIDState; -DECLARE_INSTANCE_CHECKER(USBCCIDState, USB_CCID_DEV, - TYPE_USB_CCID_DEV) +OBJECT_DECLARE_SIMPLE_TYPE(USBCCIDState, USB_CCID_DEV) /* * The two options for variable sized buffers: * make them constant size, for large enough constant, @@ -1177,8 +1175,7 @@ static Property ccid_props[] = { }; #define TYPE_CCID_BUS "ccid-bus" -DECLARE_INSTANCE_CHECKER(CCIDBus, CCID_BUS, - TYPE_CCID_BUS) +OBJECT_DECLARE_SIMPLE_TYPE(CCIDBus, CCID_BUS) static const TypeInfo ccid_bus_info = { .name = TYPE_CCID_BUS, diff --git a/hw/usb/dev-uas.c b/hw/usb/dev-uas.c index c36c8e7820..cec071d96c 100644 --- a/hw/usb/dev-uas.c +++ b/hw/usb/dev-uas.c @@ -133,8 +133,7 @@ struct UASDevice { }; #define TYPE_USB_UAS "usb-uas" -DECLARE_INSTANCE_CHECKER(UASDevice, USB_UAS, - TYPE_USB_UAS) +OBJECT_DECLARE_SIMPLE_TYPE(UASDevice, USB_UAS) struct UASRequest { uint16_t tag; diff --git a/hw/usb/dev-wacom.c b/hw/usb/dev-wacom.c index 85c4d827bf..b595048635 100644 --- a/hw/usb/dev-wacom.c +++ b/hw/usb/dev-wacom.c @@ -53,11 +53,9 @@ struct USBWacomState { uint8_t idle; int changed; }; -typedef struct USBWacomState USBWacomState; #define TYPE_USB_WACOM "usb-wacom-tablet" -DECLARE_INSTANCE_CHECKER(USBWacomState, USB_WACOM, - TYPE_USB_WACOM) +OBJECT_DECLARE_SIMPLE_TYPE(USBWacomState, USB_WACOM) enum { STR_MANUFACTURER = 1, diff --git a/hw/usb/hcd-ehci.h b/hw/usb/hcd-ehci.h index 199913bca5..fd122dd4cd 100644 --- a/hw/usb/hcd-ehci.h +++ b/hw/usb/hcd-ehci.h @@ -329,9 +329,7 @@ void usb_ehci_unrealize(EHCIState *s, DeviceState *dev); void ehci_reset(void *opaque); #define TYPE_PCI_EHCI "pci-ehci-usb" -typedef struct EHCIPCIState EHCIPCIState; -DECLARE_INSTANCE_CHECKER(EHCIPCIState, PCI_EHCI, - TYPE_PCI_EHCI) +OBJECT_DECLARE_SIMPLE_TYPE(EHCIPCIState, PCI_EHCI) struct EHCIPCIState { /*< private >*/ @@ -371,9 +369,7 @@ struct SysBusEHCIClass { uint16_t portnr; }; -typedef struct FUSBH200EHCIState FUSBH200EHCIState; -DECLARE_INSTANCE_CHECKER(FUSBH200EHCIState, FUSBH200_EHCI, - TYPE_FUSBH200_EHCI) +OBJECT_DECLARE_SIMPLE_TYPE(FUSBH200EHCIState, FUSBH200_EHCI) struct FUSBH200EHCIState { /*< private >*/ diff --git a/hw/usb/hcd-ohci-pci.c b/hw/usb/hcd-ohci-pci.c index f8168a06a3..f95199e0bb 100644 --- a/hw/usb/hcd-ohci-pci.c +++ b/hw/usb/hcd-ohci-pci.c @@ -32,9 +32,7 @@ #include "qom/object.h" #define TYPE_PCI_OHCI "pci-ohci" -typedef struct OHCIPCIState OHCIPCIState; -DECLARE_INSTANCE_CHECKER(OHCIPCIState, PCI_OHCI, - TYPE_PCI_OHCI) +OBJECT_DECLARE_SIMPLE_TYPE(OHCIPCIState, PCI_OHCI) struct OHCIPCIState { /*< private >*/ diff --git a/hw/usb/hcd-ohci.h b/hw/usb/hcd-ohci.h index 6e28e97839..11ac57058d 100644 --- a/hw/usb/hcd-ohci.h +++ b/hw/usb/hcd-ohci.h @@ -93,9 +93,7 @@ typedef struct OHCIState { } OHCIState; #define TYPE_SYSBUS_OHCI "sysbus-ohci" -typedef struct OHCISysBusState OHCISysBusState; -DECLARE_INSTANCE_CHECKER(OHCISysBusState, SYSBUS_OHCI, - TYPE_SYSBUS_OHCI) +OBJECT_DECLARE_SIMPLE_TYPE(OHCISysBusState, SYSBUS_OHCI) struct OHCISysBusState { /*< private >*/ diff --git a/hw/usb/hcd-xhci.h b/hw/usb/hcd-xhci.h index 2110c0399e..c3dfc14405 100644 --- a/hw/usb/hcd-xhci.h +++ b/hw/usb/hcd-xhci.h @@ -27,9 +27,7 @@ #define TYPE_NEC_XHCI "nec-usb-xhci" #define TYPE_QEMU_XHCI "qemu-xhci" -typedef struct XHCIState XHCIState; -DECLARE_INSTANCE_CHECKER(XHCIState, XHCI, - TYPE_XHCI) +OBJECT_DECLARE_SIMPLE_TYPE(XHCIState, XHCI) #define MAXPORTS_2 15 #define MAXPORTS_3 15 diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c index 8b02bee547..b950501d10 100644 --- a/hw/usb/host-libusb.c +++ b/hw/usb/host-libusb.c @@ -61,9 +61,7 @@ /* ------------------------------------------------------------------------ */ #define TYPE_USB_HOST_DEVICE "usb-host" -typedef struct USBHostDevice USBHostDevice; -DECLARE_INSTANCE_CHECKER(USBHostDevice, USB_HOST_DEVICE, - TYPE_USB_HOST_DEVICE) +OBJECT_DECLARE_SIMPLE_TYPE(USBHostDevice, USB_HOST_DEVICE) typedef struct USBHostRequest USBHostRequest; typedef struct USBHostIsoXfer USBHostIsoXfer; diff --git a/hw/usb/tusb6010.c b/hw/usb/tusb6010.c index dd20996d13..1dd4071e68 100644 --- a/hw/usb/tusb6010.c +++ b/hw/usb/tusb6010.c @@ -31,9 +31,7 @@ #include "qom/object.h" #define TYPE_TUSB6010 "tusb6010" -typedef struct TUSBState TUSBState; -DECLARE_INSTANCE_CHECKER(TUSBState, TUSB6010, - TYPE_TUSB6010) +OBJECT_DECLARE_SIMPLE_TYPE(TUSBState, TUSB6010) struct TUSBState { SysBusDevice parent_obj; |