From: Eduardo Habkost <ehabkost@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Kevin Wolf" <kwolf@redhat.com>,
"Daniel P. Berrange" <berrange@redhat.com>,
qemu-block@nongnu.org,
"Richard Henderson" <richard.henderson@linaro.org>,
"Greg Kurz" <groug@kaod.org>, "Max Reitz" <mreitz@redhat.com>,
"Cédric Le Goater" <clg@kaod.org>,
qemu-ppc@nongnu.org, "Gerd Hoffmann" <kraxel@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"John Snow" <jsnow@redhat.com>,
"David Gibson" <david@gibson.dropbear.id.au>
Subject: [PATCH for-6.2 11/12] [automated] Use OBJECT_DECLARE_TYPE when possible
Date: Fri, 6 Aug 2021 17:11:26 -0400 [thread overview]
Message-ID: <20210806211127.646908-12-ehabkost@redhat.com> (raw)
In-Reply-To: <20210806211127.646908-1-ehabkost@redhat.com>
Replace typedefs + DECLARE_OBJ_CHECKERS with equivalent
OBJECT_DECLARE_TYPE macro.
Generated using:
$ ./scripts/codeconverter/converter.py -i \
--pattern=AddObjectDeclareType $(git grep -l '' -- '*.[ch]')
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
Cc: John Snow <jsnow@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Max Reitz <mreitz@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: David Gibson <david@gibson.dropbear.id.au>
Cc: Greg Kurz <groug@kaod.org>
Cc: "Cédric Le Goater" <clg@kaod.org>
Cc: Richard Henderson <richard.henderson@linaro.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-block@nongnu.org
Cc: qemu-devel@nongnu.org
Cc: qemu-ppc@nongnu.org
---
hw/usb/u2f.h | 6 +-----
include/crypto/tlscreds.h | 5 +----
include/hw/ppc/spapr_drc.h | 5 +----
include/hw/ppc/spapr_xive.h | 5 +----
include/qemu/accel.h | 4 +---
hw/block/fdc-sysbus.c | 5 +----
6 files changed, 6 insertions(+), 24 deletions(-)
diff --git a/hw/usb/u2f.h b/hw/usb/u2f.h
index 5767ca8fac9..e6e3ead40f1 100644
--- a/hw/usb/u2f.h
+++ b/hw/usb/u2f.h
@@ -32,13 +32,10 @@
#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"
-typedef struct U2FKeyClass U2FKeyClass;
-DECLARE_OBJ_CHECKERS(U2FKeyState, U2FKeyClass,
- U2F_KEY, 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)
@@ -69,7 +66,6 @@ struct U2FKeyState {
uint8_t pending_in_end;
uint8_t pending_in_num;
};
-typedef struct U2FKeyState U2FKeyState;
/*
* API to be used by the U2F key device variants (i.e. hw/u2f-*.c)
diff --git a/include/crypto/tlscreds.h b/include/crypto/tlscreds.h
index 2a8a8570109..617979a3986 100644
--- a/include/crypto/tlscreds.h
+++ b/include/crypto/tlscreds.h
@@ -25,10 +25,7 @@
#include "qom/object.h"
#define TYPE_QCRYPTO_TLS_CREDS "tls-creds"
-typedef struct QCryptoTLSCreds QCryptoTLSCreds;
-typedef struct QCryptoTLSCredsClass QCryptoTLSCredsClass;
-DECLARE_OBJ_CHECKERS(QCryptoTLSCreds, QCryptoTLSCredsClass, QCRYPTO_TLS_CREDS,
- TYPE_QCRYPTO_TLS_CREDS)
+OBJECT_DECLARE_TYPE(QCryptoTLSCreds, QCryptoTLSCredsClass, QCRYPTO_TLS_CREDS)
#define QCRYPTO_TLS_CREDS_DH_PARAMS "dh-params.pem"
diff --git a/include/hw/ppc/spapr_drc.h b/include/hw/ppc/spapr_drc.h
index 540439812f0..ff876fd74ca 100644
--- a/include/hw/ppc/spapr_drc.h
+++ b/include/hw/ppc/spapr_drc.h
@@ -20,10 +20,7 @@
#include "qapi/error.h"
#define TYPE_SPAPR_DR_CONNECTOR "spapr-dr-connector"
-typedef struct SpaprDrc SpaprDrc;
-typedef struct SpaprDrcClass SpaprDrcClass;
-DECLARE_OBJ_CHECKERS(SpaprDrc, SpaprDrcClass,
- SPAPR_DR_CONNECTOR, TYPE_SPAPR_DR_CONNECTOR)
+OBJECT_DECLARE_TYPE(SpaprDrc, SpaprDrcClass, SPAPR_DR_CONNECTOR)
#define TYPE_SPAPR_DRC_PHYSICAL "spapr-drc-physical"
typedef struct SpaprDrcPhysical SpaprDrcPhysical;
diff --git a/include/hw/ppc/spapr_xive.h b/include/hw/ppc/spapr_xive.h
index 333095c3fd9..9e7c46c801f 100644
--- a/include/hw/ppc/spapr_xive.h
+++ b/include/hw/ppc/spapr_xive.h
@@ -15,10 +15,7 @@
#include "qom/object.h"
#define TYPE_SPAPR_XIVE "spapr-xive"
-typedef struct SpaprXive SpaprXive;
-typedef struct SpaprXiveClass SpaprXiveClass;
-DECLARE_OBJ_CHECKERS(SpaprXive, SpaprXiveClass,
- SPAPR_XIVE, TYPE_SPAPR_XIVE)
+OBJECT_DECLARE_TYPE(SpaprXive, SpaprXiveClass, SPAPR_XIVE)
struct SpaprXive {
XiveRouter parent;
diff --git a/include/qemu/accel.h b/include/qemu/accel.h
index 8dc4ccc39ef..1b7696f9fbc 100644
--- a/include/qemu/accel.h
+++ b/include/qemu/accel.h
@@ -54,15 +54,13 @@ struct AccelClass {
*/
GPtrArray *compat_props;
};
-typedef struct AccelClass AccelClass;
#define TYPE_ACCEL_BASE "accel"
#define ACCEL_CLASS_SUFFIX "-" TYPE_ACCEL_BASE
#define ACCEL_CLASS_NAME(a) (a ACCEL_CLASS_SUFFIX)
-DECLARE_OBJ_CHECKERS(AccelState, AccelClass,
- ACCEL_BASE, TYPE_ACCEL_BASE)
+OBJECT_DECLARE_TYPE(AccelState, AccelClass, ACCEL_BASE)
AccelClass *accel_find(const char *opt_name);
AccelState *current_accel(void);
diff --git a/hw/block/fdc-sysbus.c b/hw/block/fdc-sysbus.c
index 57fc8773f12..ecce27db34e 100644
--- a/hw/block/fdc-sysbus.c
+++ b/hw/block/fdc-sysbus.c
@@ -33,10 +33,7 @@
#include "trace.h"
#define TYPE_SYSBUS_FDC "base-sysbus-fdc"
-typedef struct FDCtrlSysBusClass FDCtrlSysBusClass;
-typedef struct FDCtrlSysBus FDCtrlSysBus;
-DECLARE_OBJ_CHECKERS(FDCtrlSysBus, FDCtrlSysBusClass,
- SYSBUS_FDC, TYPE_SYSBUS_FDC)
+OBJECT_DECLARE_TYPE(FDCtrlSysBus, FDCtrlSysBusClass, SYSBUS_FDC)
struct FDCtrlSysBusClass {
/*< private >*/
--
2.31.1
next prev parent reply other threads:[~2021-08-06 21:17 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-06 21:11 [PATCH for-6.2 00/12] qom: Get rid of all manual usage of OBJECT_CHECK & friends Eduardo Habkost
2021-08-06 21:11 ` [PATCH for-6.2 01/12] accel: Rename TYPE_ACCEL to TYPE_ACCEL_BASE Eduardo Habkost
2021-08-06 21:11 ` [PATCH for-6.2 02/12] qom: Use DEVICE_*CLASS instead of OBJECT_*CLASS Eduardo Habkost
2021-08-07 8:17 ` Philippe Mathieu-Daudé
2021-08-10 11:56 ` Juan Quintela
2021-08-10 14:22 ` Eduardo Habkost
2021-08-06 21:11 ` [PATCH for-6.2 03/12] scripts/codeconverter: Update to latest version Eduardo Habkost
2021-08-06 21:11 ` [PATCH for-6.2 04/12] [automated] Add struct names to typedefs used by QOM types Eduardo Habkost
2021-08-07 8:03 ` Philippe Mathieu-Daudé
2021-08-06 21:11 ` [PATCH for-6.2 05/12] [automated] Move QOM typedefs and add missing includes Eduardo Habkost
2021-08-07 8:13 ` Philippe Mathieu-Daudé
2021-08-10 6:06 ` Cornelia Huck
2021-08-10 12:01 ` Juan Quintela
2021-08-10 13:06 ` Eduardo Habkost
2021-08-06 21:11 ` [PATCH for-6.2 06/12] [automated] Split QOM "typedef struct T { ... } T" declarations Eduardo Habkost
2021-08-10 6:08 ` Cornelia Huck
2021-08-06 21:11 ` [PATCH for-6.2 07/12] [automated] Use DECLARE_*CHECKER* macros when possible Eduardo Habkost
2021-08-10 6:09 ` Cornelia Huck
2021-08-06 21:11 ` [PATCH for-6.2 08/12] npcm7xx_clk: Use DECLARE_INSTANCE_CHECKER Eduardo Habkost
2021-08-07 7:59 ` Philippe Mathieu-Daudé
2021-08-06 21:11 ` [PATCH for-6.2 09/12] npcm7xx_otp: Use DECLARE_CLASS_CHECKERS Eduardo Habkost
2021-08-07 8:00 ` Philippe Mathieu-Daudé
2021-08-06 21:11 ` [PATCH for-6.2 10/12] [automated] Use DECLARE_OBJ_CHECKERS when possible Eduardo Habkost
2021-08-06 21:11 ` Eduardo Habkost [this message]
2021-08-07 8:02 ` [PATCH for-6.2 11/12] [automated] Use OBJECT_DECLARE_TYPE " Philippe Mathieu-Daudé
2021-08-06 21:11 ` [PATCH for-6.2 12/12] [automated] Use OBJECT_DECLARE_SIMPLE_TYPE " Eduardo Habkost
2021-08-07 8:09 ` Philippe Mathieu-Daudé
2021-08-10 6:12 ` Cornelia Huck
2021-08-07 8:15 ` [PATCH for-6.2 00/12] qom: Get rid of all manual usage of OBJECT_CHECK & friends Philippe Mathieu-Daudé
2021-08-09 18:00 ` Eduardo Habkost
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210806211127.646908-12-ehabkost@redhat.com \
--to=ehabkost@redhat.com \
--cc=berrange@redhat.com \
--cc=clg@kaod.org \
--cc=david@gibson.dropbear.id.au \
--cc=groug@kaod.org \
--cc=jsnow@redhat.com \
--cc=kraxel@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=richard.henderson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).