[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 076/126] hw/usb/u2f: Declare QOM macros using OBJECT_DECLARE_TYPE(
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 076/126] hw/usb/u2f: Declare QOM macros using OBJECT_DECLARE_TYPE() |
Date: |
Mon, 27 Feb 2023 15:01:23 +0100 |
hw/usb/u2f.h was added by commit 80e267f1d1 ("hw/usb: Add
U2F key base class"), almost the same time of the automatic
conversion done by commit c821774a3b ("Use OBJECT_DECLARE_TYPE
where posible"). Manually convert to OBJECT_DECLARE_TYPE().
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230220150515.32549-9-philmd@linaro.org>
---
hw/usb/u2f.h | 16 +++++-----------
1 file changed, 5 insertions(+), 11 deletions(-)
diff --git a/hw/usb/u2f.h b/hw/usb/u2f.h
index a408a82927..8bff13141a 100644
--- a/hw/usb/u2f.h
+++ b/hw/usb/u2f.h
@@ -31,22 +31,16 @@
#define U2FHID_PACKET_SIZE 64
#define U2FHID_PENDING_IN_NUM 32
-typedef struct U2FKeyState U2FKeyState;
typedef struct U2FKeyInfo U2FKeyInfo;
#define TYPE_U2F_KEY "u2f-key"
-#define U2F_KEY(obj) \
- OBJECT_CHECK(U2FKeyState, (obj), TYPE_U2F_KEY)
-#define U2F_KEY_CLASS(klass) \
- OBJECT_CLASS_CHECK(U2FKeyClass, (klass), TYPE_U2F_KEY)
-#define U2F_KEY_GET_CLASS(obj) \
- OBJECT_GET_CLASS(U2FKeyClass, (obj), TYPE_U2F_KEY)
+OBJECT_DECLARE_TYPE(U2FKeyState, U2FKeyClass, U2F_KEY)
/*
* Callbacks to be used by the U2F key base device (i.e. hw/u2f.c)
* to interact with its variants (i.e. hw/u2f-*.c)
*/
-typedef struct U2FKeyClass {
+struct U2FKeyClass {
/*< private >*/
USBDeviceClass parent_class;
@@ -55,12 +49,12 @@ typedef struct U2FKeyClass {
const uint8_t packet[U2FHID_PACKET_SIZE]);
void (*realize)(U2FKeyState *key, Error **errp);
void (*unrealize)(U2FKeyState *key);
-} U2FKeyClass;
+};
/*
* State of the U2F key base device (i.e. hw/u2f.c)
*/
-typedef struct U2FKeyState {
+struct U2FKeyState {
USBDevice dev;
USBEndpoint *ep;
uint8_t idle;
@@ -70,7 +64,7 @@ typedef struct U2FKeyState {
uint8_t pending_in_start;
uint8_t pending_in_end;
uint8_t pending_in_num;
-} U2FKeyState;
+};
/*
* API to be used by the U2F key device variants (i.e. hw/u2f-*.c)
--
2.38.1
- [PULL 068/126] hw/rtc: Rename rtc_[get|set]_memory -> mc146818rtc_[get|set]_cmos_data, (continued)
- [PULL 068/126] hw/rtc: Rename rtc_[get|set]_memory -> mc146818rtc_[get|set]_cmos_data, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 065/126] hw: Replace isa_get_irq() by isa_bus_get_irq() when ISABus is available, Philippe Mathieu-Daudé, 2023/02/27
- [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é <=
- [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é, 2023/02/27
- [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