[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 078/126] hw/usb/ohci: Use OHCIState type definition
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 078/126] hw/usb/ohci: Use OHCIState type definition |
Date: |
Mon, 27 Feb 2023 15:01:25 +0100 |
Forward-define the type first, then use it for the ohci_die() handler.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230220150515.32549-3-philmd@linaro.org>
---
hw/usb/hcd-ohci.c | 2 +-
hw/usb/hcd-ohci.h | 10 ++++++----
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c
index 9d68036d23..7ecf9b15b7 100644
--- a/hw/usb/hcd-ohci.c
+++ b/hw/usb/hcd-ohci.c
@@ -1827,7 +1827,7 @@ static USBBusOps ohci_bus_ops = {
void usb_ohci_init(OHCIState *ohci, DeviceState *dev, uint32_t num_ports,
dma_addr_t localmem_base, char *masterbus,
uint32_t firstport, AddressSpace *as,
- void (*ohci_die_fn)(struct OHCIState *), Error **errp)
+ void (*ohci_die_fn)(OHCIState *), Error **errp)
{
Error *err = NULL;
int i;
diff --git a/hw/usb/hcd-ohci.h b/hw/usb/hcd-ohci.h
index e5e6b434fd..e1827227ac 100644
--- a/hw/usb/hcd-ohci.h
+++ b/hw/usb/hcd-ohci.h
@@ -34,7 +34,9 @@ typedef struct OHCIPort {
uint32_t ctrl;
} OHCIPort;
-typedef struct OHCIState {
+typedef struct OHCIState OHCIState;
+
+struct OHCIState {
USBBus bus;
qemu_irq irq;
MemoryRegion mem;
@@ -90,8 +92,8 @@ typedef struct OHCIState {
uint32_t async_td;
bool async_complete;
- void (*ohci_die)(struct OHCIState *ohci);
-} OHCIState;
+ void (*ohci_die)(OHCIState *ohci);
+};
#define TYPE_SYSBUS_OHCI "sysbus-ohci"
OBJECT_DECLARE_SIMPLE_TYPE(OHCISysBusState, SYSBUS_OHCI)
@@ -113,7 +115,7 @@ extern const VMStateDescription vmstate_ohci_state;
void usb_ohci_init(OHCIState *ohci, DeviceState *dev, uint32_t num_ports,
dma_addr_t localmem_base, char *masterbus,
uint32_t firstport, AddressSpace *as,
- void (*ohci_die_fn)(struct OHCIState *), Error **errp);
+ void (*ohci_die_fn)(OHCIState *), Error **errp);
void ohci_bus_stop(OHCIState *ohci);
void ohci_stop_endpoints(OHCIState *ohci);
void ohci_hard_reset(OHCIState *ohci);
--
2.38.1
- [PULL 067/126] hw/rtc/mc146818rtc: Pass MC146818RtcState instead of ISADevice argument, (continued)
- [PULL 067/126] hw/rtc/mc146818rtc: Pass MC146818RtcState instead of ISADevice argument, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 069/126] hw/timer/hpet: Include missing 'hw/qdev-properties.h' header, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 070/126] hw/audio/hda-codec: Avoid forward-declaring HDAAudioState, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 071/126] hw/audio/es1370: Avoid forward-declaring ES1370State, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 072/126] hw/audio/es1370: Replace container_of() by ES1370() QOM cast macro, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 073/126] hw/audio/ac97: Replace container_of() by AC97() QOM cast macro, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 075/126] hw/usb/dev-smartcard-reader: Avoid forward-declaring CCIDBus, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 074/126] hw/audio/ac97: Split off some definitions to a header, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 076/126] hw/usb/u2f: Declare QOM macros using OBJECT_DECLARE_TYPE(), Philippe Mathieu-Daudé, 2023/02/27
- [PULL 077/126] hw/usb/ohci: Include missing 'sysbus.h' header, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 078/126] hw/usb/ohci: Use OHCIState type definition,
Philippe Mathieu-Daudé <=
- [PULL 080/126] hw/usb/ohci: Code style fix white space errors, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 081/126] hw/usb/ohci: Code style fix missing braces and extra parenthesis, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 082/126] hw/usb/ohci: Move a function next to where it is used, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 079/126] hw/usb/ohci: Code style fix comments, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 083/126] hw/usb/ohci: Add trace points for register access, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 084/126] hw/usb/ohci: Fix typo, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 087/126] hw/usb/xhci-nec: Declare QOM macros for NEC_XHCI, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 089/126] hw/display/sm501: Embed OHCI QOM child in chipset, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 086/126] hw/usb/uhci: Replace container_of() by UHCI_GET_CLASS() QOM macro, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 088/126] hw/usb/xhci-nec: Replace container_of() by NEC_XHCI() QOM cast macro, Philippe Mathieu-Daudé, 2023/02/27