summaryrefslogtreecommitdiffstats
path: root/hw/nvram
diff options
context:
space:
mode:
authorEduardo Habkost2020-08-31 23:07:33 +0200
committerEduardo Habkost2020-09-09 15:27:09 +0200
commit8110fa1d94f2997badc2af39231a1d279c5bb1ee (patch)
tree6bff28c7907dfb0cbb367ca113f4d02ea03f3a51 /hw/nvram
parentMove QOM typedefs and add missing includes (diff)
downloadqemu-8110fa1d94f2997badc2af39231a1d279c5bb1ee.tar.gz
qemu-8110fa1d94f2997badc2af39231a1d279c5bb1ee.tar.xz
qemu-8110fa1d94f2997badc2af39231a1d279c5bb1ee.zip
Use DECLARE_*CHECKER* macros
Generated using: $ ./scripts/codeconverter/converter.py -i \ --pattern=TypeCheckMacro $(git grep -l '' -- '*.[ch]') Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Message-Id: <20200831210740.126168-12-ehabkost@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Message-Id: <20200831210740.126168-13-ehabkost@redhat.com> Message-Id: <20200831210740.126168-14-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'hw/nvram')
-rw-r--r--hw/nvram/ds1225y.c3
-rw-r--r--hw/nvram/eeprom_at24c.c3
-rw-r--r--hw/nvram/spapr_nvram.c4
3 files changed, 6 insertions, 4 deletions
diff --git a/hw/nvram/ds1225y.c b/hw/nvram/ds1225y.c
index 99e27e9174..44fb7a94d3 100644
--- a/hw/nvram/ds1225y.c
+++ b/hw/nvram/ds1225y.c
@@ -111,7 +111,8 @@ static const VMStateDescription vmstate_nvram = {
#define TYPE_DS1225Y "ds1225y"
typedef struct SysBusNvRamState SysBusNvRamState;
-#define DS1225Y(obj) OBJECT_CHECK(SysBusNvRamState, (obj), TYPE_DS1225Y)
+DECLARE_INSTANCE_CHECKER(SysBusNvRamState, DS1225Y,
+ TYPE_DS1225Y)
struct SysBusNvRamState {
SysBusDevice parent_obj;
diff --git a/hw/nvram/eeprom_at24c.c b/hw/nvram/eeprom_at24c.c
index 4bf7519bc7..3e93dbbffb 100644
--- a/hw/nvram/eeprom_at24c.c
+++ b/hw/nvram/eeprom_at24c.c
@@ -29,7 +29,8 @@
#define TYPE_AT24C_EE "at24c-eeprom"
typedef struct EEPROMState EEPROMState;
-#define AT24C_EE(obj) OBJECT_CHECK(EEPROMState, (obj), TYPE_AT24C_EE)
+DECLARE_INSTANCE_CHECKER(EEPROMState, AT24C_EE,
+ TYPE_AT24C_EE)
struct EEPROMState {
I2CSlave parent_obj;
diff --git a/hw/nvram/spapr_nvram.c b/hw/nvram/spapr_nvram.c
index b9218e0b89..57ccc174f2 100644
--- a/hw/nvram/spapr_nvram.c
+++ b/hw/nvram/spapr_nvram.c
@@ -51,8 +51,8 @@ struct SpaprNvram {
typedef struct SpaprNvram SpaprNvram;
#define TYPE_VIO_SPAPR_NVRAM "spapr-nvram"
-#define VIO_SPAPR_NVRAM(obj) \
- OBJECT_CHECK(SpaprNvram, (obj), TYPE_VIO_SPAPR_NVRAM)
+DECLARE_INSTANCE_CHECKER(SpaprNvram, VIO_SPAPR_NVRAM,
+ TYPE_VIO_SPAPR_NVRAM)
#define MIN_NVRAM_SIZE (8 * KiB)
#define DEFAULT_NVRAM_SIZE (64 * KiB)