aboutsummaryrefslogtreecommitdiff
path: root/hw/audio
diff options
context:
space:
mode:
authorEduardo Habkost <ehabkost@redhat.com>2020-08-31 17:07:33 -0400
committerEduardo Habkost <ehabkost@redhat.com>2020-09-09 09:27:09 -0400
commit8110fa1d94f2997badc2af39231a1d279c5bb1ee (patch)
tree6bff28c7907dfb0cbb367ca113f4d02ea03f3a51 /hw/audio
parentdb1015e92e04835c9eb50c29625fe566d1202dbd (diff)
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/audio')
-rw-r--r--hw/audio/ac97.c4
-rw-r--r--hw/audio/adlib.c3
-rw-r--r--hw/audio/cs4231.c4
-rw-r--r--hw/audio/cs4231a.c3
-rw-r--r--hw/audio/es1370.c4
-rw-r--r--hw/audio/gus.c3
-rw-r--r--hw/audio/hda-codec.c3
-rw-r--r--hw/audio/intel-hda.c4
-rw-r--r--hw/audio/intel-hda.h11
-rw-r--r--hw/audio/marvell_88w8618.c4
-rw-r--r--hw/audio/milkymist-ac97.c4
-rw-r--r--hw/audio/pcspk.c3
-rw-r--r--hw/audio/pl041.c3
-rw-r--r--hw/audio/sb16.c3
-rw-r--r--hw/audio/wm8750.c3
15 files changed, 32 insertions, 27 deletions
diff --git a/hw/audio/ac97.c b/hw/audio/ac97.c
index 9614419b7a..eb8a7f032d 100644
--- a/hw/audio/ac97.c
+++ b/hw/audio/ac97.c
@@ -128,8 +128,8 @@ enum {
#define TYPE_AC97 "AC97"
typedef struct AC97LinkState AC97LinkState;
-#define AC97(obj) \
- OBJECT_CHECK(AC97LinkState, (obj), TYPE_AC97)
+DECLARE_INSTANCE_CHECKER(AC97LinkState, AC97,
+ TYPE_AC97)
#define REC_MASK 7
enum {
diff --git a/hw/audio/adlib.c b/hw/audio/adlib.c
index a216fe1925..870116e324 100644
--- a/hw/audio/adlib.c
+++ b/hw/audio/adlib.c
@@ -53,7 +53,8 @@
#define TYPE_ADLIB "adlib"
typedef struct AdlibState AdlibState;
-#define ADLIB(obj) OBJECT_CHECK(AdlibState, (obj), TYPE_ADLIB)
+DECLARE_INSTANCE_CHECKER(AdlibState, ADLIB,
+ TYPE_ADLIB)
struct AdlibState {
ISADevice parent_obj;
diff --git a/hw/audio/cs4231.c b/hw/audio/cs4231.c
index 2b868051c3..8e9554ce9b 100644
--- a/hw/audio/cs4231.c
+++ b/hw/audio/cs4231.c
@@ -39,8 +39,8 @@
#define TYPE_CS4231 "SUNW,CS4231"
typedef struct CSState CSState;
-#define CS4231(obj) \
- OBJECT_CHECK(CSState, (obj), TYPE_CS4231)
+DECLARE_INSTANCE_CHECKER(CSState, CS4231,
+ TYPE_CS4231)
struct CSState {
SysBusDevice parent_obj;
diff --git a/hw/audio/cs4231a.c b/hw/audio/cs4231a.c
index fc064a93d7..7d60ce6f0e 100644
--- a/hw/audio/cs4231a.c
+++ b/hw/audio/cs4231a.c
@@ -64,7 +64,8 @@ static struct {
#define TYPE_CS4231A "cs4231a"
typedef struct CSState CSState;
-#define CS4231A(obj) OBJECT_CHECK (CSState, (obj), TYPE_CS4231A)
+DECLARE_INSTANCE_CHECKER(CSState, CS4231A,
+ TYPE_CS4231A)
struct CSState {
ISADevice dev;
diff --git a/hw/audio/es1370.c b/hw/audio/es1370.c
index bd620d5ee2..a824f8949e 100644
--- a/hw/audio/es1370.c
+++ b/hw/audio/es1370.c
@@ -293,8 +293,8 @@ struct chan_bits {
};
#define TYPE_ES1370 "ES1370"
-#define ES1370(obj) \
- OBJECT_CHECK(ES1370State, (obj), TYPE_ES1370)
+DECLARE_INSTANCE_CHECKER(ES1370State, ES1370,
+ TYPE_ES1370)
static void es1370_dac1_calc_freq (ES1370State *s, uint32_t ctl,
uint32_t *old_freq, uint32_t *new_freq);
diff --git a/hw/audio/gus.c b/hw/audio/gus.c
index 3cd62d43d7..307fd48315 100644
--- a/hw/audio/gus.c
+++ b/hw/audio/gus.c
@@ -44,7 +44,8 @@
#define TYPE_GUS "gus"
typedef struct GUSState GUSState;
-#define GUS(obj) OBJECT_CHECK (GUSState, (obj), TYPE_GUS)
+DECLARE_INSTANCE_CHECKER(GUSState, GUS,
+ TYPE_GUS)
struct GUSState {
ISADevice dev;
diff --git a/hw/audio/hda-codec.c b/hw/audio/hda-codec.c
index 8dee2915be..77d31b91a4 100644
--- a/hw/audio/hda-codec.c
+++ b/hw/audio/hda-codec.c
@@ -172,7 +172,8 @@ struct HDAAudioStream {
};
#define TYPE_HDA_AUDIO "hda-audio"
-#define HDA_AUDIO(obj) OBJECT_CHECK(HDAAudioState, (obj), TYPE_HDA_AUDIO)
+DECLARE_INSTANCE_CHECKER(HDAAudioState, HDA_AUDIO,
+ TYPE_HDA_AUDIO)
struct HDAAudioState {
HDACodecDevice hda;
diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c
index de30443c2e..4330213fff 100644
--- a/hw/audio/intel-hda.c
+++ b/hw/audio/intel-hda.c
@@ -204,8 +204,8 @@ struct IntelHDAState {
#define TYPE_INTEL_HDA_GENERIC "intel-hda-generic"
-#define INTEL_HDA(obj) \
- OBJECT_CHECK(IntelHDAState, (obj), TYPE_INTEL_HDA_GENERIC)
+DECLARE_INSTANCE_CHECKER(IntelHDAState, INTEL_HDA,
+ TYPE_INTEL_HDA_GENERIC)
struct IntelHDAReg {
const char *name; /* register name */
diff --git a/hw/audio/intel-hda.h b/hw/audio/intel-hda.h
index 44a2897fff..813a7a357d 100644
--- a/hw/audio/intel-hda.h
+++ b/hw/audio/intel-hda.h
@@ -10,16 +10,13 @@
#define TYPE_HDA_CODEC_DEVICE "hda-codec"
typedef struct HDACodecDevice HDACodecDevice;
typedef struct HDACodecDeviceClass HDACodecDeviceClass;
-#define HDA_CODEC_DEVICE(obj) \
- OBJECT_CHECK(HDACodecDevice, (obj), TYPE_HDA_CODEC_DEVICE)
-#define HDA_CODEC_DEVICE_CLASS(klass) \
- OBJECT_CLASS_CHECK(HDACodecDeviceClass, (klass), TYPE_HDA_CODEC_DEVICE)
-#define HDA_CODEC_DEVICE_GET_CLASS(obj) \
- OBJECT_GET_CLASS(HDACodecDeviceClass, (obj), TYPE_HDA_CODEC_DEVICE)
+DECLARE_OBJ_CHECKERS(HDACodecDevice, HDACodecDeviceClass,
+ HDA_CODEC_DEVICE, TYPE_HDA_CODEC_DEVICE)
#define TYPE_HDA_BUS "HDA"
typedef struct HDACodecBus HDACodecBus;
-#define HDA_BUS(obj) OBJECT_CHECK(HDACodecBus, (obj), TYPE_HDA_BUS)
+DECLARE_INSTANCE_CHECKER(HDACodecBus, HDA_BUS,
+ TYPE_HDA_BUS)
typedef void (*hda_codec_response_func)(HDACodecDevice *dev,
diff --git a/hw/audio/marvell_88w8618.c b/hw/audio/marvell_88w8618.c
index 5f2e7f3b73..c8641562cc 100644
--- a/hw/audio/marvell_88w8618.c
+++ b/hw/audio/marvell_88w8618.c
@@ -44,8 +44,8 @@
#define MP_AUDIO_MONO (1 << 14)
typedef struct mv88w8618_audio_state mv88w8618_audio_state;
-#define MV88W8618_AUDIO(obj) \
- OBJECT_CHECK(mv88w8618_audio_state, (obj), TYPE_MV88W8618_AUDIO)
+DECLARE_INSTANCE_CHECKER(mv88w8618_audio_state, MV88W8618_AUDIO,
+ TYPE_MV88W8618_AUDIO)
struct mv88w8618_audio_state {
SysBusDevice parent_obj;
diff --git a/hw/audio/milkymist-ac97.c b/hw/audio/milkymist-ac97.c
index 4eacd4071a..7893539019 100644
--- a/hw/audio/milkymist-ac97.c
+++ b/hw/audio/milkymist-ac97.c
@@ -57,8 +57,8 @@ enum {
#define TYPE_MILKYMIST_AC97 "milkymist-ac97"
typedef struct MilkymistAC97State MilkymistAC97State;
-#define MILKYMIST_AC97(obj) \
- OBJECT_CHECK(MilkymistAC97State, (obj), TYPE_MILKYMIST_AC97)
+DECLARE_INSTANCE_CHECKER(MilkymistAC97State, MILKYMIST_AC97,
+ TYPE_MILKYMIST_AC97)
struct MilkymistAC97State {
SysBusDevice parent_obj;
diff --git a/hw/audio/pcspk.c b/hw/audio/pcspk.c
index 57edbe652c..cbee8855fb 100644
--- a/hw/audio/pcspk.c
+++ b/hw/audio/pcspk.c
@@ -41,7 +41,8 @@
#define PCSPK_MIN_COUNT DIV_ROUND_UP(PIT_FREQ, PCSPK_MAX_FREQ)
typedef struct PCSpkState PCSpkState;
-#define PC_SPEAKER(obj) OBJECT_CHECK(PCSpkState, (obj), TYPE_PC_SPEAKER)
+DECLARE_INSTANCE_CHECKER(PCSpkState, PC_SPEAKER,
+ TYPE_PC_SPEAKER)
struct PCSpkState {
ISADevice parent_obj;
diff --git a/hw/audio/pl041.c b/hw/audio/pl041.c
index e514a8cd70..570a234b72 100644
--- a/hw/audio/pl041.c
+++ b/hw/audio/pl041.c
@@ -79,7 +79,8 @@ typedef struct {
#define TYPE_PL041 "pl041"
typedef struct PL041State PL041State;
-#define PL041(obj) OBJECT_CHECK(PL041State, (obj), TYPE_PL041)
+DECLARE_INSTANCE_CHECKER(PL041State, PL041,
+ TYPE_PL041)
struct PL041State {
SysBusDevice parent_obj;
diff --git a/hw/audio/sb16.c b/hw/audio/sb16.c
index 840f743e41..6aa2c0fb93 100644
--- a/hw/audio/sb16.c
+++ b/hw/audio/sb16.c
@@ -51,7 +51,8 @@ static const char e3[] = "COPYRIGHT (C) CREATIVE TECHNOLOGY LTD, 1992.";
#define TYPE_SB16 "sb16"
typedef struct SB16State SB16State;
-#define SB16(obj) OBJECT_CHECK (SB16State, (obj), TYPE_SB16)
+DECLARE_INSTANCE_CHECKER(SB16State, SB16,
+ TYPE_SB16)
struct SB16State {
ISADevice parent_obj;
diff --git a/hw/audio/wm8750.c b/hw/audio/wm8750.c
index dae23f43a4..7d6fcfec03 100644
--- a/hw/audio/wm8750.c
+++ b/hw/audio/wm8750.c
@@ -28,7 +28,8 @@ typedef struct {
} WMRate;
typedef struct WM8750State WM8750State;
-#define WM8750(obj) OBJECT_CHECK(WM8750State, (obj), TYPE_WM8750)
+DECLARE_INSTANCE_CHECKER(WM8750State, WM8750,
+ TYPE_WM8750)
struct WM8750State {
I2CSlave parent_obj;