diff options
author | Eduardo Habkost <ehabkost@redhat.com> | 2020-08-31 17:07:33 -0400 |
---|---|---|
committer | Eduardo Habkost <ehabkost@redhat.com> | 2020-09-09 09:27:09 -0400 |
commit | 8110fa1d94f2997badc2af39231a1d279c5bb1ee (patch) | |
tree | 6bff28c7907dfb0cbb367ca113f4d02ea03f3a51 /hw/block | |
parent | db1015e92e04835c9eb50c29625fe566d1202dbd (diff) | |
download | 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/block')
-rw-r--r-- | hw/block/fdc.c | 13 | ||||
-rw-r--r-- | hw/block/m25p80.c | 8 | ||||
-rw-r--r-- | hw/block/nand.c | 4 | ||||
-rw-r--r-- | hw/block/onenand.c | 3 |
4 files changed, 14 insertions, 14 deletions
diff --git a/hw/block/fdc.c b/hw/block/fdc.c index 70bfb136e4..224bac504f 100644 --- a/hw/block/fdc.c +++ b/hw/block/fdc.c @@ -66,7 +66,8 @@ #define TYPE_FLOPPY_BUS "floppy-bus" typedef struct FloppyBus FloppyBus; -#define FLOPPY_BUS(obj) OBJECT_CHECK(FloppyBus, (obj), TYPE_FLOPPY_BUS) +DECLARE_INSTANCE_CHECKER(FloppyBus, FLOPPY_BUS, + TYPE_FLOPPY_BUS) typedef struct FDCtrl FDCtrl; typedef struct FDrive FDrive; @@ -497,8 +498,8 @@ static const BlockDevOps fd_block_ops = { #define TYPE_FLOPPY_DRIVE "floppy" typedef struct FloppyDrive FloppyDrive; -#define FLOPPY_DRIVE(obj) \ - OBJECT_CHECK(FloppyDrive, (obj), TYPE_FLOPPY_DRIVE) +DECLARE_INSTANCE_CHECKER(FloppyDrive, FLOPPY_DRIVE, + TYPE_FLOPPY_DRIVE) struct FloppyDrive { DeviceState qdev; @@ -890,7 +891,8 @@ static FloppyDriveType get_fallback_drive_type(FDrive *drv) #define TYPE_SYSBUS_FDC "base-sysbus-fdc" typedef struct FDCtrlSysBus FDCtrlSysBus; -#define SYSBUS_FDC(obj) OBJECT_CHECK(FDCtrlSysBus, (obj), TYPE_SYSBUS_FDC) +DECLARE_INSTANCE_CHECKER(FDCtrlSysBus, SYSBUS_FDC, + TYPE_SYSBUS_FDC) struct FDCtrlSysBus { /*< private >*/ @@ -901,7 +903,8 @@ struct FDCtrlSysBus { }; typedef struct FDCtrlISABus FDCtrlISABus; -#define ISA_FDC(obj) OBJECT_CHECK(FDCtrlISABus, (obj), TYPE_ISA_FDC) +DECLARE_INSTANCE_CHECKER(FDCtrlISABus, ISA_FDC, + TYPE_ISA_FDC) struct FDCtrlISABus { ISADevice parent_obj; diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c index 9de4f9b274..8dae779c76 100644 --- a/hw/block/m25p80.c +++ b/hw/block/m25p80.c @@ -465,12 +465,8 @@ struct M25P80Class { typedef struct M25P80Class M25P80Class; #define TYPE_M25P80 "m25p80-generic" -#define M25P80(obj) \ - OBJECT_CHECK(Flash, (obj), TYPE_M25P80) -#define M25P80_CLASS(klass) \ - OBJECT_CLASS_CHECK(M25P80Class, (klass), TYPE_M25P80) -#define M25P80_GET_CLASS(obj) \ - OBJECT_GET_CLASS(M25P80Class, (obj), TYPE_M25P80) +DECLARE_OBJ_CHECKERS(Flash, M25P80Class, + M25P80, TYPE_M25P80) static inline Manufacturer get_man(Flash *s) { diff --git a/hw/block/nand.c b/hw/block/nand.c index 7c7a08b7aa..5c8112ed5a 100644 --- a/hw/block/nand.c +++ b/hw/block/nand.c @@ -90,8 +90,8 @@ struct NANDFlashState { #define TYPE_NAND "nand" -#define NAND(obj) \ - OBJECT_CHECK(NANDFlashState, (obj), TYPE_NAND) +DECLARE_INSTANCE_CHECKER(NANDFlashState, NAND, + TYPE_NAND) static void mem_and(uint8_t *dest, const uint8_t *src, size_t n) { diff --git a/hw/block/onenand.c b/hw/block/onenand.c index 5fe235d11d..19f55aba66 100644 --- a/hw/block/onenand.c +++ b/hw/block/onenand.c @@ -41,7 +41,8 @@ #define TYPE_ONE_NAND "onenand" typedef struct OneNANDState OneNANDState; -#define ONE_NAND(obj) OBJECT_CHECK(OneNANDState, (obj), TYPE_ONE_NAND) +DECLARE_INSTANCE_CHECKER(OneNANDState, ONE_NAND, + TYPE_ONE_NAND) struct OneNANDState { SysBusDevice parent_obj; |