[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 5/6] qbus: Rename qbus_create() to qbus_new()
From: |
Corey Minyard |
Subject: |
Re: [PATCH 5/6] qbus: Rename qbus_create() to qbus_new() |
Date: |
Thu, 23 Sep 2021 11:00:20 -0500 |
On Thu, Sep 23, 2021 at 01:11:52PM +0100, Peter Maydell wrote:
> Rename the "allocate and return" qbus creation function to
> qbus_new(), to bring it into line with our _init vs _new convention.
This looks like a good idea to me.
Reviewed-by: Corey Minyard <cminyard@mvista.com>
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> include/hw/qdev-core.h | 2 +-
> hw/core/bus.c | 2 +-
> hw/hyperv/vmbus.c | 2 +-
> hw/i2c/core.c | 2 +-
> hw/isa/isa-bus.c | 2 +-
> hw/misc/auxbus.c | 2 +-
> hw/nubus/mac-nubus-bridge.c | 2 +-
> hw/pci/pci.c | 2 +-
> hw/ppc/spapr_vio.c | 2 +-
> hw/s390x/ap-bridge.c | 2 +-
> hw/s390x/css-bridge.c | 2 +-
> hw/s390x/s390-pci-bus.c | 2 +-
> hw/ssi/ssi.c | 2 +-
> hw/xen/xen-bus.c | 2 +-
> hw/xen/xen-legacy-backend.c | 2 +-
> 15 files changed, 15 insertions(+), 15 deletions(-)
>
> diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h
> index ebca8cf9fca..4ff19c714bd 100644
> --- a/include/hw/qdev-core.h
> +++ b/include/hw/qdev-core.h
> @@ -680,7 +680,7 @@ typedef int (qdev_walkerfn)(DeviceState *dev, void
> *opaque);
>
> void qbus_init(void *bus, size_t size, const char *typename,
> DeviceState *parent, const char *name);
> -BusState *qbus_create(const char *typename, DeviceState *parent, const char
> *name);
> +BusState *qbus_new(const char *typename, DeviceState *parent, const char
> *name);
> bool qbus_realize(BusState *bus, Error **errp);
> void qbus_unrealize(BusState *bus);
>
> diff --git a/hw/core/bus.c b/hw/core/bus.c
> index cec49985024..c7831b5293b 100644
> --- a/hw/core/bus.c
> +++ b/hw/core/bus.c
> @@ -159,7 +159,7 @@ void qbus_init(void *bus, size_t size, const char
> *typename,
> qbus_init_internal(bus, parent, name);
> }
>
> -BusState *qbus_create(const char *typename, DeviceState *parent, const char
> *name)
> +BusState *qbus_new(const char *typename, DeviceState *parent, const char
> *name)
> {
> BusState *bus;
>
> diff --git a/hw/hyperv/vmbus.c b/hw/hyperv/vmbus.c
> index c9887d5a7bc..dbce3b35fba 100644
> --- a/hw/hyperv/vmbus.c
> +++ b/hw/hyperv/vmbus.c
> @@ -2729,7 +2729,7 @@ static void vmbus_bridge_realize(DeviceState *dev,
> Error **errp)
> return;
> }
>
> - bridge->bus = VMBUS(qbus_create(TYPE_VMBUS, dev, "vmbus"));
> + bridge->bus = VMBUS(qbus_new(TYPE_VMBUS, dev, "vmbus"));
> }
>
> static char *vmbus_bridge_ofw_unit_address(const SysBusDevice *dev)
> diff --git a/hw/i2c/core.c b/hw/i2c/core.c
> index 416372ad00c..0e7d2763b9e 100644
> --- a/hw/i2c/core.c
> +++ b/hw/i2c/core.c
> @@ -60,7 +60,7 @@ I2CBus *i2c_init_bus(DeviceState *parent, const char *name)
> {
> I2CBus *bus;
>
> - bus = I2C_BUS(qbus_create(TYPE_I2C_BUS, parent, name));
> + bus = I2C_BUS(qbus_new(TYPE_I2C_BUS, parent, name));
> QLIST_INIT(&bus->current_devs);
> vmstate_register(NULL, VMSTATE_INSTANCE_ID_ANY, &vmstate_i2c_bus, bus);
> return bus;
> diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c
> index cffaa35e9cf..6c31398dda6 100644
> --- a/hw/isa/isa-bus.c
> +++ b/hw/isa/isa-bus.c
> @@ -64,7 +64,7 @@ ISABus *isa_bus_new(DeviceState *dev, MemoryRegion*
> address_space,
> sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
> }
>
> - isabus = ISA_BUS(qbus_create(TYPE_ISA_BUS, dev, NULL));
> + isabus = ISA_BUS(qbus_new(TYPE_ISA_BUS, dev, NULL));
> isabus->address_space = address_space;
> isabus->address_space_io = address_space_io;
> return isabus;
> diff --git a/hw/misc/auxbus.c b/hw/misc/auxbus.c
> index 434ff8d910d..8a8012f5f08 100644
> --- a/hw/misc/auxbus.c
> +++ b/hw/misc/auxbus.c
> @@ -65,7 +65,7 @@ AUXBus *aux_bus_init(DeviceState *parent, const char *name)
> AUXBus *bus;
> Object *auxtoi2c;
>
> - bus = AUX_BUS(qbus_create(TYPE_AUX_BUS, parent, name));
> + bus = AUX_BUS(qbus_new(TYPE_AUX_BUS, parent, name));
> auxtoi2c = object_new_with_props(TYPE_AUXTOI2C, OBJECT(bus), "i2c",
> &error_abort, NULL);
>
> diff --git a/hw/nubus/mac-nubus-bridge.c b/hw/nubus/mac-nubus-bridge.c
> index 7c329300b82..148979dab13 100644
> --- a/hw/nubus/mac-nubus-bridge.c
> +++ b/hw/nubus/mac-nubus-bridge.c
> @@ -16,7 +16,7 @@ static void mac_nubus_bridge_init(Object *obj)
> MacNubusState *s = MAC_NUBUS_BRIDGE(obj);
> SysBusDevice *sbd = SYS_BUS_DEVICE(obj);
>
> - s->bus = NUBUS_BUS(qbus_create(TYPE_NUBUS_BUS, DEVICE(s), NULL));
> + s->bus = NUBUS_BUS(qbus_new(TYPE_NUBUS_BUS, DEVICE(s), NULL));
>
> sysbus_init_mmio(sbd, &s->bus->super_slot_io);
> sysbus_init_mmio(sbd, &s->bus->slot_io);
> diff --git a/hw/pci/pci.c b/hw/pci/pci.c
> index 14cb15a0aa1..186758ee11f 100644
> --- a/hw/pci/pci.c
> +++ b/hw/pci/pci.c
> @@ -478,7 +478,7 @@ PCIBus *pci_root_bus_new(DeviceState *parent, const char
> *name,
> {
> PCIBus *bus;
>
> - bus = PCI_BUS(qbus_create(typename, parent, name));
> + bus = PCI_BUS(qbus_new(typename, parent, name));
> pci_root_bus_internal_init(bus, parent, address_space_mem,
> address_space_io, devfn_min);
> return bus;
> diff --git a/hw/ppc/spapr_vio.c b/hw/ppc/spapr_vio.c
> index b59452bcd62..b975ed29cad 100644
> --- a/hw/ppc/spapr_vio.c
> +++ b/hw/ppc/spapr_vio.c
> @@ -577,7 +577,7 @@ SpaprVioBus *spapr_vio_bus_init(void)
> sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
>
> /* Create bus on bridge device */
> - qbus = qbus_create(TYPE_SPAPR_VIO_BUS, dev, "spapr-vio");
> + qbus = qbus_new(TYPE_SPAPR_VIO_BUS, dev, "spapr-vio");
> bus = SPAPR_VIO_BUS(qbus);
> bus->next_reg = SPAPR_VIO_REG_BASE;
>
> diff --git a/hw/s390x/ap-bridge.c b/hw/s390x/ap-bridge.c
> index 8bcf8ece9dd..ef8fa2b15be 100644
> --- a/hw/s390x/ap-bridge.c
> +++ b/hw/s390x/ap-bridge.c
> @@ -55,7 +55,7 @@ void s390_init_ap(void)
> sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
>
> /* Create bus on bridge device */
> - bus = qbus_create(TYPE_AP_BUS, dev, TYPE_AP_BUS);
> + bus = qbus_new(TYPE_AP_BUS, dev, TYPE_AP_BUS);
>
> /* Enable hotplugging */
> qbus_set_hotplug_handler(bus, OBJECT(dev));
> diff --git a/hw/s390x/css-bridge.c b/hw/s390x/css-bridge.c
> index 191b29f0771..4017081d49c 100644
> --- a/hw/s390x/css-bridge.c
> +++ b/hw/s390x/css-bridge.c
> @@ -106,7 +106,7 @@ VirtualCssBus *virtual_css_bus_init(void)
> sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
>
> /* Create bus on bridge device */
> - bus = qbus_create(TYPE_VIRTUAL_CSS_BUS, dev, "virtual-css");
> + bus = qbus_new(TYPE_VIRTUAL_CSS_BUS, dev, "virtual-css");
> cbus = VIRTUAL_CSS_BUS(bus);
>
> /* Enable hotplugging */
> diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c
> index 6c0225c3a01..6fafffb029a 100644
> --- a/hw/s390x/s390-pci-bus.c
> +++ b/hw/s390x/s390-pci-bus.c
> @@ -813,7 +813,7 @@ static void s390_pcihost_realize(DeviceState *dev, Error
> **errp)
> qbus_set_hotplug_handler(bus, OBJECT(dev));
> phb->bus = b;
>
> - s->bus = S390_PCI_BUS(qbus_create(TYPE_S390_PCI_BUS, dev, NULL));
> + s->bus = S390_PCI_BUS(qbus_new(TYPE_S390_PCI_BUS, dev, NULL));
> qbus_set_hotplug_handler(BUS(s->bus), OBJECT(dev));
>
> s->iommu_table = g_hash_table_new_full(g_int64_hash, g_int64_equal,
> diff --git a/hw/ssi/ssi.c b/hw/ssi/ssi.c
> index e5d7ce95237..003931fb509 100644
> --- a/hw/ssi/ssi.c
> +++ b/hw/ssi/ssi.c
> @@ -107,7 +107,7 @@ DeviceState *ssi_create_peripheral(SSIBus *bus, const
> char *name)
> SSIBus *ssi_create_bus(DeviceState *parent, const char *name)
> {
> BusState *bus;
> - bus = qbus_create(TYPE_SSI_BUS, parent, name);
> + bus = qbus_new(TYPE_SSI_BUS, parent, name);
> return SSI_BUS(bus);
> }
>
> diff --git a/hw/xen/xen-bus.c b/hw/xen/xen-bus.c
> index 8c588920d9f..416583f130b 100644
> --- a/hw/xen/xen-bus.c
> +++ b/hw/xen/xen-bus.c
> @@ -1398,7 +1398,7 @@ type_init(xen_register_types)
> void xen_bus_init(void)
> {
> DeviceState *dev = qdev_new(TYPE_XEN_BRIDGE);
> - BusState *bus = qbus_create(TYPE_XEN_BUS, dev, NULL);
> + BusState *bus = qbus_new(TYPE_XEN_BUS, dev, NULL);
>
> sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
> qbus_set_bus_hotplug_handler(bus);
> diff --git a/hw/xen/xen-legacy-backend.c b/hw/xen/xen-legacy-backend.c
> index dd8ae1452d1..be3cf4a195e 100644
> --- a/hw/xen/xen-legacy-backend.c
> +++ b/hw/xen/xen-legacy-backend.c
> @@ -702,7 +702,7 @@ int xen_be_init(void)
>
> xen_sysdev = qdev_new(TYPE_XENSYSDEV);
> sysbus_realize_and_unref(SYS_BUS_DEVICE(xen_sysdev), &error_fatal);
> - xen_sysbus = qbus_create(TYPE_XENSYSBUS, xen_sysdev, "xen-sysbus");
> + xen_sysbus = qbus_new(TYPE_XENSYSBUS, xen_sysdev, "xen-sysbus");
> qbus_set_bus_hotplug_handler(xen_sysbus);
>
> return 0;
> --
> 2.20.1
>
>
- [PATCH 0/6] Improve consistency of bus init function names, Peter Maydell, 2021/09/23
- [PATCH 1/6] scsi: Replace scsi_bus_new() with scsi_bus_init(), scsi_bus_init_named(), Peter Maydell, 2021/09/23
- [PATCH 2/6] ipack: Rename ipack_bus_new_inplace() to ipack_bus_init(), Peter Maydell, 2021/09/23
- [PATCH 6/6] ide: Rename ide_bus_new() to ide_bus_init(), Peter Maydell, 2021/09/23
- [PATCH 4/6] qbus: Rename qbus_create_inplace() to qbus_init(), Peter Maydell, 2021/09/23
- [PATCH 3/6] pci: Rename pci_root_bus_new_inplace() to pci_root_bus_init(), Peter Maydell, 2021/09/23
- [PATCH 5/6] qbus: Rename qbus_create() to qbus_new(), Peter Maydell, 2021/09/23
- Re: [PATCH 5/6] qbus: Rename qbus_create() to qbus_new(),
Corey Minyard <=
- Re: [PATCH 0/6] Improve consistency of bus init function names, Philippe Mathieu-Daudé, 2021/09/23
- Re: [PATCH 0/6] Improve consistency of bus init function names, Michael S. Tsirkin, 2021/09/23
- Re: [PATCH 0/6] Improve consistency of bus init function names, Peter Maydell, 2021/09/30