From: "Alex Bennée" <alex.bennee@linaro.org>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>
Cc: qemu-block@nongnu.org, Eduardo Habkost <eduardo@habkost.net>,
John Snow <jsnow@redhat.com>,
qemu-devel@nongnu.org
Subject: Re: [PATCH 02/20] hw/ide/mmio: Use CamelCase for MMIO_IDE state name
Date: Wed, 15 Feb 2023 17:29:04 +0000 [thread overview]
Message-ID: <875yc2al9u.fsf@linaro.org> (raw)
In-Reply-To: <20230215112712.23110-3-philmd@linaro.org>
Philippe Mathieu-Daudé <philmd@linaro.org> writes:
> Following docs/devel/style.rst guidelines, rename MMIOIDEState
> as IdeMmioState.
Erm the comment doesn't match what you've done s/MMIOState/MMIOIDEState/
>
> Having the structure name and its typedef named equally, we can
> manually convert from the old DECLARE_INSTANCE_CHECKER() macro to the
> more recent OBJECT_DECLARE_SIMPLE_TYPE().
>
> Note, due to that name mismatch, this macro wasn't automatically
> converted during commit 8063396bf3 ("Use OBJECT_DECLARE_SIMPLE_TYPE
> when possible").
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> hw/ide/mmio.c | 28 +++++++++++++---------------
> 1 file changed, 13 insertions(+), 15 deletions(-)
>
> diff --git a/hw/ide/mmio.c b/hw/ide/mmio.c
> index fb2ebd4847..f1c6e1479b 100644
> --- a/hw/ide/mmio.c
> +++ b/hw/ide/mmio.c
> @@ -40,9 +40,7 @@
> */
>
> #define TYPE_MMIO_IDE "mmio-ide"
> -typedef struct MMIOIDEState MMIOState;
> -DECLARE_INSTANCE_CHECKER(MMIOState, MMIO_IDE,
> - TYPE_MMIO_IDE)
> +OBJECT_DECLARE_SIMPLE_TYPE(MMIOIDEState, MMIO_IDE)
>
> struct MMIOIDEState {
> /*< private >*/
> @@ -58,7 +56,7 @@ struct MMIOIDEState {
>
> static void mmio_ide_reset(DeviceState *dev)
> {
> - MMIOState *s = MMIO_IDE(dev);
> + MMIOIDEState *s = MMIO_IDE(dev);
>
> ide_bus_reset(&s->bus);
> }
> @@ -66,7 +64,7 @@ static void mmio_ide_reset(DeviceState *dev)
> static uint64_t mmio_ide_read(void *opaque, hwaddr addr,
> unsigned size)
> {
> - MMIOState *s = opaque;
> + MMIOIDEState *s = opaque;
> addr >>= s->shift;
> if (addr & 7)
> return ide_ioport_read(&s->bus, addr);
> @@ -77,7 +75,7 @@ static uint64_t mmio_ide_read(void *opaque, hwaddr addr,
> static void mmio_ide_write(void *opaque, hwaddr addr,
> uint64_t val, unsigned size)
> {
> - MMIOState *s = opaque;
> + MMIOIDEState *s = opaque;
> addr >>= s->shift;
> if (addr & 7)
> ide_ioport_write(&s->bus, addr, val);
> @@ -94,14 +92,14 @@ static const MemoryRegionOps mmio_ide_ops = {
> static uint64_t mmio_ide_status_read(void *opaque, hwaddr addr,
> unsigned size)
> {
> - MMIOState *s= opaque;
> + MMIOIDEState *s= opaque;
> return ide_status_read(&s->bus, 0);
> }
>
> static void mmio_ide_ctrl_write(void *opaque, hwaddr addr,
> uint64_t val, unsigned size)
> {
> - MMIOState *s = opaque;
> + MMIOIDEState *s = opaque;
> ide_ctrl_write(&s->bus, 0, val);
> }
>
> @@ -116,8 +114,8 @@ static const VMStateDescription vmstate_ide_mmio = {
> .version_id = 3,
> .minimum_version_id = 0,
> .fields = (VMStateField[]) {
> - VMSTATE_IDE_BUS(bus, MMIOState),
> - VMSTATE_IDE_DRIVES(bus.ifs, MMIOState),
> + VMSTATE_IDE_BUS(bus, MMIOIDEState),
> + VMSTATE_IDE_DRIVES(bus.ifs, MMIOIDEState),
> VMSTATE_END_OF_LIST()
> }
> };
> @@ -125,7 +123,7 @@ static const VMStateDescription vmstate_ide_mmio = {
> static void mmio_ide_realizefn(DeviceState *dev, Error **errp)
> {
> SysBusDevice *d = SYS_BUS_DEVICE(dev);
> - MMIOState *s = MMIO_IDE(dev);
> + MMIOIDEState *s = MMIO_IDE(dev);
>
> ide_init2(&s->bus, s->irq);
>
> @@ -140,14 +138,14 @@ static void mmio_ide_realizefn(DeviceState *dev, Error **errp)
> static void mmio_ide_initfn(Object *obj)
> {
> SysBusDevice *d = SYS_BUS_DEVICE(obj);
> - MMIOState *s = MMIO_IDE(obj);
> + MMIOIDEState *s = MMIO_IDE(obj);
>
> ide_bus_init(&s->bus, sizeof(s->bus), DEVICE(obj), 0, 2);
> sysbus_init_irq(d, &s->irq);
> }
>
> static Property mmio_ide_properties[] = {
> - DEFINE_PROP_UINT32("shift", MMIOState, shift, 0),
> + DEFINE_PROP_UINT32("shift", MMIOIDEState, shift, 0),
> DEFINE_PROP_END_OF_LIST()
> };
>
> @@ -164,7 +162,7 @@ static void mmio_ide_class_init(ObjectClass *oc, void *data)
> static const TypeInfo mmio_ide_type_info = {
> .name = TYPE_MMIO_IDE,
> .parent = TYPE_SYS_BUS_DEVICE,
> - .instance_size = sizeof(MMIOState),
> + .instance_size = sizeof(MMIOIDEState),
> .instance_init = mmio_ide_initfn,
> .class_init = mmio_ide_class_init,
> };
> @@ -176,7 +174,7 @@ static void mmio_ide_register_types(void)
>
> void mmio_ide_init_drives(DeviceState *dev, DriveInfo *hd0, DriveInfo *hd1)
> {
> - MMIOState *s = MMIO_IDE(dev);
> + MMIOIDEState *s = MMIO_IDE(dev);
>
> if (hd0 != NULL) {
> ide_create_drive(&s->bus, 0, hd0);
--
Alex Bennée
Virtualisation Tech Lead @ Linaro
next prev parent reply other threads:[~2023-02-15 17:31 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-15 11:26 [PATCH 00/20] hw/ide: QOM/QDev housekeeping Philippe Mathieu-Daudé
2023-02-15 11:26 ` [PATCH 01/20] MAINTAINERS: Mark IDE and Floppy as "Odd Fixes" Philippe Mathieu-Daudé
2023-02-15 17:27 ` Alex Bennée
2023-02-15 20:51 ` Philippe Mathieu-Daudé
2023-02-15 11:26 ` [PATCH 02/20] hw/ide/mmio: Use CamelCase for MMIO_IDE state name Philippe Mathieu-Daudé
2023-02-15 17:29 ` Alex Bennée [this message]
2023-02-15 11:26 ` [PATCH 03/20] hw/ide/mmio: Extract TYPE_MMIO_IDE declarations to 'hw/ide/mmio.h' Philippe Mathieu-Daudé
2023-02-15 17:32 ` Alex Bennée
2023-02-15 19:06 ` Richard Henderson
2023-02-15 11:26 ` [PATCH 04/20] hw/ide/isa: Extract TYPE_ISA_IDE declarations to 'hw/ide/isa.h' Philippe Mathieu-Daudé
2023-02-15 19:08 ` Richard Henderson
2023-02-16 14:19 ` Bernhard Beschow
2023-02-15 11:26 ` [PATCH 05/20] hw/ide/isa: Remove intermediate ISAIDEState::irq variable Philippe Mathieu-Daudé
2023-02-15 17:54 ` Bernhard Beschow
2023-02-15 19:08 ` Richard Henderson
2023-02-15 11:26 ` [PATCH 06/20] hw/ide/atapi: Restrict 'scsi/constants.h' inclusion Philippe Mathieu-Daudé
2023-02-15 19:09 ` Richard Henderson
2023-02-15 11:26 ` [PATCH 07/20] hw/ide: Remove unused 'qapi/qapi-types-run-state.h' Philippe Mathieu-Daudé
2023-02-15 19:09 ` Richard Henderson
2023-02-15 11:27 ` [PATCH 08/20] hw/ide: Include 'exec/ioport.h' instead of 'hw/isa/isa.h' Philippe Mathieu-Daudé
2023-02-15 19:09 ` Richard Henderson
2023-02-15 11:27 ` [PATCH 09/20] hw/ide: Un-inline ide_set_irq() Philippe Mathieu-Daudé
2023-02-15 19:11 ` Richard Henderson
2023-02-15 11:27 ` [PATCH 10/20] hw/ide: Rename ide_set_irq() -> ide_bus_set_irq() Philippe Mathieu-Daudé
2023-02-15 19:12 ` Richard Henderson
2023-02-15 11:27 ` [PATCH 11/20] hw/ide: Rename ide_create_drive() -> ide_bus_create_drive() Philippe Mathieu-Daudé
2023-02-15 19:13 ` Richard Henderson
2023-02-15 11:27 ` [PATCH 12/20] hw/ide: Rename ide_register_restart_cb -> ide_bus_register_restart_cb Philippe Mathieu-Daudé
2023-02-15 19:13 ` Richard Henderson
2023-02-15 11:27 ` [PATCH 13/20] hw/ide: Rename ide_exec_cmd() -> ide_bus_exec_cmd() Philippe Mathieu-Daudé
2023-02-15 19:14 ` Richard Henderson
2023-02-15 11:27 ` [PATCH 14/20] hw/ide: Rename ide_init2() -> ide_bus_init_output_irq() Philippe Mathieu-Daudé
2023-02-15 15:40 ` Philippe Mathieu-Daudé
2023-02-15 19:15 ` Richard Henderson
2023-02-16 0:10 ` Bernhard Beschow
2023-02-15 11:27 ` [PATCH 15/20] hw/ide: Rename idebus_active_if() -> ide_bus_active_if() Philippe Mathieu-Daudé
2023-02-15 19:16 ` Richard Henderson
2023-02-15 11:27 ` [PATCH 16/20] hw/ide/ioport: Remove unnecessary includes Philippe Mathieu-Daudé
2023-02-15 19:17 ` Richard Henderson
2023-02-15 11:27 ` [PATCH 17/20] hw/ide/pci: Unexport bmdma_active_if() Philippe Mathieu-Daudé
2023-02-15 18:13 ` Bernhard Beschow
2023-02-15 21:09 ` BALATON Zoltan
2023-02-16 0:18 ` Bernhard Beschow
2023-02-16 0:33 ` Bernhard Beschow
2023-02-15 19:17 ` Richard Henderson
2023-02-15 11:27 ` [PATCH 18/20] hw/ide/piix: Remove unused includes Philippe Mathieu-Daudé
2023-02-15 19:18 ` Richard Henderson
2023-02-15 11:27 ` [PATCH 19/20] hw/ide/piix: Pass Error* to pci_piix_init_ports() for better error msg Philippe Mathieu-Daudé
2023-02-15 19:20 ` Richard Henderson
2023-02-15 11:27 ` [PATCH 20/20] hw/ide/piix: Refactor pci_piix_init_ports as pci_piix_init_bus per bus Philippe Mathieu-Daudé
2023-02-15 19:21 ` Richard Henderson
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=875yc2al9u.fsf@linaro.org \
--to=alex.bennee@linaro.org \
--cc=eduardo@habkost.net \
--cc=jsnow@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-block@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).