mirror of
https://github.com/qemu/qemu.git
synced 2025-01-21 13:03:26 +08:00
swim: Rename struct SWIM to Swim
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> Acked-by: Laurent Vivier <laurent@vivier.eu> Tested-By: Roman Bolshakov <r.bolshakov@yadro.com> Message-Id: <20200825192110.3528606-50-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
This commit is contained in:
parent
b1af5872ff
commit
b694ed1f56
@ -387,7 +387,7 @@ static const MemoryRegionOps swimctrl_mem_ops = {
|
|||||||
|
|
||||||
static void sysbus_swim_reset(DeviceState *d)
|
static void sysbus_swim_reset(DeviceState *d)
|
||||||
{
|
{
|
||||||
SWIM *sys = SWIM(d);
|
Swim *sys = SWIM(d);
|
||||||
SWIMCtrl *ctrl = &sys->ctrl;
|
SWIMCtrl *ctrl = &sys->ctrl;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -408,7 +408,7 @@ static void sysbus_swim_reset(DeviceState *d)
|
|||||||
static void sysbus_swim_init(Object *obj)
|
static void sysbus_swim_init(Object *obj)
|
||||||
{
|
{
|
||||||
SysBusDevice *sbd = SYS_BUS_DEVICE(obj);
|
SysBusDevice *sbd = SYS_BUS_DEVICE(obj);
|
||||||
SWIM *sbs = SWIM(obj);
|
Swim *sbs = SWIM(obj);
|
||||||
SWIMCtrl *swimctrl = &sbs->ctrl;
|
SWIMCtrl *swimctrl = &sbs->ctrl;
|
||||||
|
|
||||||
memory_region_init_io(&swimctrl->iomem, obj, &swimctrl_mem_ops, swimctrl,
|
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)
|
static void sysbus_swim_realize(DeviceState *dev, Error **errp)
|
||||||
{
|
{
|
||||||
SWIM *sys = SWIM(dev);
|
Swim *sys = SWIM(dev);
|
||||||
SWIMCtrl *swimctrl = &sys->ctrl;
|
SWIMCtrl *swimctrl = &sys->ctrl;
|
||||||
|
|
||||||
qbus_create_inplace(&swimctrl->bus, sizeof(SWIMBus), TYPE_SWIM_BUS, dev,
|
qbus_create_inplace(&swimctrl->bus, sizeof(SWIMBus), TYPE_SWIM_BUS, dev,
|
||||||
@ -460,7 +460,7 @@ static const VMStateDescription vmstate_sysbus_swim = {
|
|||||||
.name = "SWIM",
|
.name = "SWIM",
|
||||||
.version_id = 1,
|
.version_id = 1,
|
||||||
.fields = (VMStateField[]) {
|
.fields = (VMStateField[]) {
|
||||||
VMSTATE_STRUCT(ctrl, SWIM, 0, vmstate_swim, SWIMCtrl),
|
VMSTATE_STRUCT(ctrl, Swim, 0, vmstate_swim, SWIMCtrl),
|
||||||
VMSTATE_END_OF_LIST()
|
VMSTATE_END_OF_LIST()
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -477,7 +477,7 @@ static void sysbus_swim_class_init(ObjectClass *oc, void *data)
|
|||||||
static const TypeInfo sysbus_swim_info = {
|
static const TypeInfo sysbus_swim_info = {
|
||||||
.name = TYPE_SWIM,
|
.name = TYPE_SWIM,
|
||||||
.parent = TYPE_SYS_BUS_DEVICE,
|
.parent = TYPE_SYS_BUS_DEVICE,
|
||||||
.instance_size = sizeof(SWIM),
|
.instance_size = sizeof(Swim),
|
||||||
.instance_init = sysbus_swim_init,
|
.instance_init = sysbus_swim_init,
|
||||||
.class_init = sysbus_swim_class_init,
|
.class_init = sysbus_swim_class_init,
|
||||||
};
|
};
|
||||||
|
@ -67,10 +67,10 @@ struct SWIMCtrl {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#define TYPE_SWIM "swim"
|
#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;
|
SysBusDevice parent_obj;
|
||||||
SWIMCtrl ctrl;
|
SWIMCtrl ctrl;
|
||||||
} SWIM;
|
} Swim;
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user