qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 49/74] swim: Rename struct SWIM to Swim


From: Laurent Vivier
Subject: Re: [PATCH v3 49/74] swim: Rename struct SWIM to Swim
Date: Wed, 26 Aug 2020 12:19:06 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

Le 25/08/2020 à 21:20, Eduardo Habkost a écrit :
> Currently we have a SWIM typedef and a SWIM type checking macro,
> but OBJECT_DECLARE* would transform the SWIM macro into a
> function, and the function name would conflict with the SWIM
> typedef name.
> 
> Rename the struct and typedef to "Swim". This will make future
> conversion to OBJECT_DECLARE* easier.
> 
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
> Changes series v2 -> v3: new patch added to series v3
> 
> ---
> Cc: Laurent Vivier <laurent@vivier.eu>
> Cc: Kevin Wolf <kwolf@redhat.com>
> Cc: Max Reitz <mreitz@redhat.com>
> Cc: qemu-block@nongnu.org
> Cc: qemu-devel@nongnu.org
> 
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
>  include/hw/block/swim.h |  6 +++---
>  hw/block/swim.c         | 10 +++++-----
>  2 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/include/hw/block/swim.h b/include/hw/block/swim.h
> index 6add3499d0..9d8b65c561 100644
> --- a/include/hw/block/swim.h
> +++ b/include/hw/block/swim.h
> @@ -67,10 +67,10 @@ struct SWIMCtrl {
>  };
>  
>  #define TYPE_SWIM "swim"
> -#define SWIM(obj) OBJECT_CHECK(SWIM, (obj), TYPE_SWIM)
> +#define SWIM(obj) OBJECT_CHECK(Swim, (obj), TYPE_SWIM)
>  
> -typedef struct SWIM {
> +typedef struct Swim {
>      SysBusDevice parent_obj;
>      SWIMCtrl     ctrl;
> -} SWIM;
> +} Swim;
>  #endif
> diff --git a/hw/block/swim.c b/hw/block/swim.c
> index 74f56e8f46..20133a814c 100644
> --- a/hw/block/swim.c
> +++ b/hw/block/swim.c
> @@ -387,7 +387,7 @@ static const MemoryRegionOps swimctrl_mem_ops = {
>  
>  static void sysbus_swim_reset(DeviceState *d)
>  {
> -    SWIM *sys = SWIM(d);
> +    Swim *sys = SWIM(d);
>      SWIMCtrl *ctrl = &sys->ctrl;
>      int i;
>  
> @@ -408,7 +408,7 @@ static void sysbus_swim_reset(DeviceState *d)
>  static void sysbus_swim_init(Object *obj)
>  {
>      SysBusDevice *sbd = SYS_BUS_DEVICE(obj);
> -    SWIM *sbs = SWIM(obj);
> +    Swim *sbs = SWIM(obj);
>      SWIMCtrl *swimctrl = &sbs->ctrl;
>  
>      memory_region_init_io(&swimctrl->iomem, obj, &swimctrl_mem_ops, swimctrl,
> @@ -418,7 +418,7 @@ static void sysbus_swim_init(Object *obj)
>  
>  static void sysbus_swim_realize(DeviceState *dev, Error **errp)
>  {
> -    SWIM *sys = SWIM(dev);
> +    Swim *sys = SWIM(dev);
>      SWIMCtrl *swimctrl = &sys->ctrl;
>  
>      qbus_create_inplace(&swimctrl->bus, sizeof(SWIMBus), TYPE_SWIM_BUS, dev,
> @@ -460,7 +460,7 @@ static const VMStateDescription vmstate_sysbus_swim = {
>      .name = "SWIM",
>      .version_id = 1,
>      .fields = (VMStateField[]) {
> -        VMSTATE_STRUCT(ctrl, SWIM, 0, vmstate_swim, SWIMCtrl),
> +        VMSTATE_STRUCT(ctrl, Swim, 0, vmstate_swim, SWIMCtrl),
>          VMSTATE_END_OF_LIST()
>      }
>  };
> @@ -477,7 +477,7 @@ static void sysbus_swim_class_init(ObjectClass *oc, void 
> *data)
>  static const TypeInfo sysbus_swim_info = {
>      .name          = TYPE_SWIM,
>      .parent        = TYPE_SYS_BUS_DEVICE,
> -    .instance_size = sizeof(SWIM),
> +    .instance_size = sizeof(Swim),
>      .instance_init = sysbus_swim_init,
>      .class_init    = sysbus_swim_class_init,
>  };
> 

Acked-by: Laurent Vivier <laurent@vivier.eu>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]