aboutsummaryrefslogtreecommitdiff
path: root/hw/usb
diff options
context:
space:
mode:
authorEduardo Habkost <ehabkost@redhat.com>2020-09-16 14:25:19 -0400
committerEduardo Habkost <ehabkost@redhat.com>2020-09-18 14:12:32 -0400
commit8063396bf3459a810d24e3efd6110b8480f0de5b (patch)
tree40f85f15d7016e3ee66916a59be53d2b2c71510a /hw/usb
parenta489d1951cd9cc91c5954214fcf6ae0f9d2d4292 (diff)
downloadqemu-8063396bf3459a810d24e3efd6110b8480f0de5b.zip
qemu-8063396bf3459a810d24e3efd6110b8480f0de5b.tar.gz
qemu-8063396bf3459a810d24e3efd6110b8480f0de5b.tar.bz2
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.c4
-rw-r--r--hw/usb/dev-hid.c4
-rw-r--r--hw/usb/dev-hub.c4
-rw-r--r--hw/usb/dev-mtp.c3
-rw-r--r--hw/usb/dev-network.c4
-rw-r--r--hw/usb/dev-serial.c4
-rw-r--r--hw/usb/dev-smartcard-reader.c7
-rw-r--r--hw/usb/dev-uas.c3
-rw-r--r--hw/usb/dev-wacom.c4
-rw-r--r--hw/usb/hcd-ehci.h8
-rw-r--r--hw/usb/hcd-ohci-pci.c4
-rw-r--r--hw/usb/hcd-ohci.h4
-rw-r--r--hw/usb/hcd-xhci.h4
-rw-r--r--hw/usb/host-libusb.c4
-rw-r--r--hw/usb/tusb6010.c4
15 files changed, 17 insertions, 48 deletions
diff --git a/hw/usb/dev-audio.c b/hw/usb/dev-audio.c
index 65247ca..e1486f8 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 05cfe6b..fc39bab 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 7a182f9..40c1f90 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 c61c0e0..bbb8274 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 cd32f57..6c49c16 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 1a038a2..b1622b7 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 59b2248..946df97 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 c36c8e7..cec071d 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 85c4d82..b595048 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 199913b..fd122dd 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 f8168a0..f95199e 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 6e28e97..11ac570 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 2110c03..c3dfc14 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 8b02bee..b950501 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 dd20996..1dd4071 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;