From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Mao Zhongyi <maozhongyi@cmss.chinamobile.com>,
qemu-devel@nongnu.org,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
Juan Quintela <quintela@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
Jan Kiszka <jan.kiszka@web.de>, Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 4/4] audio: use existing macros istead of hardcoded strings
Date: Thu, 11 Oct 2018 12:45:54 +0200 [thread overview]
Message-ID: <997db16e-3da8-b66a-b29b-517674ae860f@redhat.com> (raw)
In-Reply-To: <20181011090007.1103-5-maozhongyi@cmss.chinamobile.com>
On 11/10/2018 11:00, Mao Zhongyi wrote:
> Cc: Jan Kiszka <jan.kiszka@web.de>
> Cc: Peter Maydell <peter.maydell@linaro.org>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> To: qemu-arm@nongnu.org
>
> Signed-off-by: Mao Zhongyi <maozhongyi@cmss.chinamobile.com>
> ---
> hw/arm/musicpal.c | 16 ++++++++--------
> hw/audio/marvell_88w8618.c | 3 +--
> include/hw/audio/wm8750.h | 1 +
> 3 files changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c
> index ac266f9253..6425f1d50f 100644
> --- a/hw/arm/musicpal.c
> +++ b/hw/arm/musicpal.c
> @@ -406,7 +406,7 @@ static void mv88w8618_eth_realize(DeviceState *dev, Error **errp)
> }
>
> static const VMStateDescription mv88w8618_eth_vmsd = {
> - .name = "mv88w8618_eth",
> + .name = TYPE_MV88W8618_ETH,
I understand TYPE_device name might changed, but once used,
VMStateDescription shouldn't, else this would break migration.
Thus I wouldn't recommend using TYPE_name in VMStateDescription.name.
Since I'm not sure I cc'ed the migration maintainers.
> .version_id = 1,
> .minimum_version_id = 1,
> .fields = (VMStateField[]) {
> @@ -645,7 +645,7 @@ static void musicpal_lcd_init(Object *obj)
> }
>
> static const VMStateDescription musicpal_lcd_vmsd = {
> - .name = "musicpal_lcd",
> + .name = TYPE_MUSICPAL_LCD,
> .version_id = 1,
> .minimum_version_id = 1,
> .fields = (VMStateField[]) {
> @@ -771,7 +771,7 @@ static void mv88w8618_pic_init(Object *obj)
> }
>
> static const VMStateDescription mv88w8618_pic_vmsd = {
> - .name = "mv88w8618_pic",
> + .name = TYPE_MV88W8618_PIC,
> .version_id = 1,
> .minimum_version_id = 1,
> .fields = (VMStateField[]) {
> @@ -951,7 +951,7 @@ static const VMStateDescription mv88w8618_timer_vmsd = {
> };
>
> static const VMStateDescription mv88w8618_pit_vmsd = {
> - .name = "mv88w8618_pit",
> + .name = TYPE_MV88W8618_PIT,
> .version_id = 1,
> .minimum_version_id = 1,
> .fields = (VMStateField[]) {
> @@ -1038,7 +1038,7 @@ static void mv88w8618_flashcfg_init(Object *obj)
> }
>
> static const VMStateDescription mv88w8618_flashcfg_vmsd = {
> - .name = "mv88w8618_flashcfg",
> + .name = TYPE_MV88W8618_FLASHCFG,
> .version_id = 1,
> .minimum_version_id = 1,
> .fields = (VMStateField[]) {
> @@ -1375,7 +1375,7 @@ static void musicpal_gpio_init(Object *obj)
> }
>
> static const VMStateDescription musicpal_gpio_vmsd = {
> - .name = "musicpal_gpio",
> + .name = TYPE_MUSICPAL_GPIO,
> .version_id = 1,
> .minimum_version_id = 1,
> .fields = (VMStateField[]) {
> @@ -1539,7 +1539,7 @@ static void musicpal_key_init(Object *obj)
> }
>
> static const VMStateDescription musicpal_key_vmsd = {
> - .name = "musicpal_key",
> + .name = TYPE_MUSICPAL_KEY,
> .version_id = 1,
> .minimum_version_id = 1,
> .fields = (VMStateField[]) {
> @@ -1693,7 +1693,7 @@ static void musicpal_init(MachineState *machine)
> }
>
> wm8750_dev = i2c_create_slave(i2c, TYPE_WM8750, MP_WM_ADDR);
> - dev = qdev_create(NULL, "mv88w8618_audio");
> + dev = qdev_create(NULL, TYPE_MV88W8618_AUDIO);
This change is correct.
> s = SYS_BUS_DEVICE(dev);
> object_property_set_link(OBJECT(dev), OBJECT(wm8750_dev),
> TYPE_WM8750, NULL);
> diff --git a/hw/audio/marvell_88w8618.c b/hw/audio/marvell_88w8618.c
> index baab4a3d53..dbdddf8ef4 100644
> --- a/hw/audio/marvell_88w8618.c
> +++ b/hw/audio/marvell_88w8618.c
> @@ -39,7 +39,6 @@
> #define MP_AUDIO_CLOCK_24MHZ (1 << 9)
> #define MP_AUDIO_MONO (1 << 14)
>
> -#define TYPE_MV88W8618_AUDIO "mv88w8618_audio"
> #define MV88W8618_AUDIO(obj) \
> OBJECT_CHECK(mv88w8618_audio_state, (obj), TYPE_MV88W8618_AUDIO)
>
> @@ -268,7 +267,7 @@ static void mv88w8618_audio_realize(DeviceState *dev, Error **errp)
> }
>
> static const VMStateDescription mv88w8618_audio_vmsd = {
> - .name = "mv88w8618_audio",
> + .name = TYPE_MV88W8618_AUDIO,
> .version_id = 1,
> .minimum_version_id = 1,
> .fields = (VMStateField[]) {
> diff --git a/include/hw/audio/wm8750.h b/include/hw/audio/wm8750.h
> index 84e7a119bb..e12cb886d1 100644
> --- a/include/hw/audio/wm8750.h
> +++ b/include/hw/audio/wm8750.h
> @@ -17,6 +17,7 @@
> #include "hw/hw.h"
>
> #define TYPE_WM8750 "wm8750"
> +#define TYPE_MV88W8618_AUDIO "mv88w8618_audio"
>
> typedef void data_req_cb(void *opaque, int free_out, int free_in);
>
>
Regards,
Phil.
next prev parent reply other threads:[~2018-10-11 10:46 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-11 9:00 [Qemu-devel] [PATCH 0/4] use object link instead of qdev property Mao Zhongyi
2018-10-11 9:00 ` [Qemu-devel] [PATCH 1/4] wm8750: remove duplicate macro Mao Zhongyi
2018-10-11 10:39 ` Philippe Mathieu-Daudé
2018-10-12 1:09 ` maozy
2018-10-11 9:00 ` [Qemu-devel] [PATCH 2/4] audio: use TYPE_WM8750 instead of a hardcoded string Mao Zhongyi
2018-10-11 10:40 ` Philippe Mathieu-Daudé
2018-10-11 9:00 ` [Qemu-devel] [PATCH 3/4] audio: use object link instead of qdev property to pass wm8750 reference Mao Zhongyi
2018-10-11 9:00 ` [Qemu-devel] [PATCH 4/4] audio: use existing macros istead of hardcoded strings Mao Zhongyi
2018-10-11 10:45 ` Philippe Mathieu-Daudé [this message]
2018-10-11 11:05 ` Peter Maydell
2018-10-12 1:16 ` [Qemu-devel] [PATCH 4/4] audio: use existing macros istead ofhardcoded strings maozy
2018-10-17 11:55 ` [Qemu-devel] [PATCH 4/4] audio: use existing macros istead of hardcoded strings Juan Quintela
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=997db16e-3da8-b66a-b29b-517674ae860f@redhat.com \
--to=philmd@redhat.com \
--cc=dgilbert@redhat.com \
--cc=jan.kiszka@web.de \
--cc=kraxel@redhat.com \
--cc=maozhongyi@cmss.chinamobile.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
/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).