qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eduardo Habkost <ehabkost@redhat.com>
To: qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	qemu-arm@nongnu.org, "Daniel P. Berrange" <berrange@redhat.com>,
	Havard Skinnemoen <hskinnemoen@google.com>,
	Tyrone Ting <kfting@nuvoton.com>
Subject: [PATCH for-6.2 09/12] npcm7xx_otp: Use DECLARE_CLASS_CHECKERS
Date: Fri,  6 Aug 2021 17:11:24 -0400	[thread overview]
Message-ID: <20210806211127.646908-10-ehabkost@redhat.com> (raw)
In-Reply-To: <20210806211127.646908-1-ehabkost@redhat.com>

Use DECLARE_CLASS_CHECKERS instead of defining the
NPCM7XX_OTP_CLASS and NPCM7XX_OTP_GET_CLASS macros manually.

These changes had to be done manually because the typedef and the
existing macro definitions were in different files.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
Cc: Havard Skinnemoen <hskinnemoen@google.com>
Cc: Tyrone Ting <kfting@nuvoton.com>
Cc: qemu-arm@nongnu.org
Cc: qemu-devel@nongnu.org
---
 include/hw/nvram/npcm7xx_otp.h | 5 +++--
 hw/nvram/npcm7xx_otp.c         | 5 -----
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/include/hw/nvram/npcm7xx_otp.h b/include/hw/nvram/npcm7xx_otp.h
index 4cfc6577e87..0a3ebb091d5 100644
--- a/include/hw/nvram/npcm7xx_otp.h
+++ b/include/hw/nvram/npcm7xx_otp.h
@@ -60,12 +60,13 @@ typedef struct NPCM7xxOTPState NPCM7xxOTPState;
 #define TYPE_NPCM7XX_OTP "npcm7xx-otp"
 DECLARE_INSTANCE_CHECKER(NPCM7xxOTPState, NPCM7XX_OTP,
                          TYPE_NPCM7XX_OTP)
+typedef struct NPCM7xxOTPClass NPCM7xxOTPClass;
+DECLARE_CLASS_CHECKERS(NPCM7xxOTPClass, NPCM7XX_OTP,
+                       TYPE_NPCM7XX_OTP)
 
 #define TYPE_NPCM7XX_KEY_STORAGE "npcm7xx-key-storage"
 #define TYPE_NPCM7XX_FUSE_ARRAY "npcm7xx-fuse-array"
 
-typedef struct NPCM7xxOTPClass NPCM7xxOTPClass;
-
 /**
  * npcm7xx_otp_array_write - ECC encode and write data to OTP array.
  * @s: OTP module.
diff --git a/hw/nvram/npcm7xx_otp.c b/hw/nvram/npcm7xx_otp.c
index 52b9482419e..61085c5228b 100644
--- a/hw/nvram/npcm7xx_otp.c
+++ b/hw/nvram/npcm7xx_otp.c
@@ -73,11 +73,6 @@ struct NPCM7xxOTPClass {
     const MemoryRegionOps *mmio_ops;
 };
 
-#define NPCM7XX_OTP_CLASS(klass) \
-    OBJECT_CLASS_CHECK(NPCM7xxOTPClass, (klass), TYPE_NPCM7XX_OTP)
-#define NPCM7XX_OTP_GET_CLASS(obj) \
-    OBJECT_GET_CLASS(NPCM7xxOTPClass, (obj), TYPE_NPCM7XX_OTP)
-
 static uint8_t ecc_encode_nibble(uint8_t n)
 {
     uint8_t result = n;
-- 
2.31.1



  parent reply	other threads:[~2021-08-06 21:19 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 ` Eduardo Habkost [this message]
2021-08-07  8:00   ` [PATCH for-6.2 09/12] npcm7xx_otp: Use DECLARE_CLASS_CHECKERS 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 ` [PATCH for-6.2 11/12] [automated] Use OBJECT_DECLARE_TYPE " Eduardo Habkost
2021-08-07  8:02   ` 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-10-ehabkost@redhat.com \
    --to=ehabkost@redhat.com \
    --cc=berrange@redhat.com \
    --cc=hskinnemoen@google.com \
    --cc=kfting@nuvoton.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.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).