aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorBernhard Beschow <shentey@gmail.com>2023-06-30 09:37:13 +0200
committerMichael S. Tsirkin <mst@redhat.com>2023-07-10 16:29:17 -0400
commita707466dd62712e4a76e30217a8880e6ab8c7b10 (patch)
tree375ae2e5d31a632cd7341363901702d599409360 /hw
parentcda39f134ba197e2c8c9660dd3fb8fddf4c8647b (diff)
downloadqemu-a707466dd62712e4a76e30217a8880e6ab8c7b10.zip
qemu-a707466dd62712e4a76e30217a8880e6ab8c7b10.tar.gz
qemu-a707466dd62712e4a76e30217a8880e6ab8c7b10.tar.bz2
hw/pci-host/i440fx: Have common names for some local variables
`PCIHostState` is often referred to as `phb`, own device state usually as `s`. Signed-off-by: Bernhard Beschow <shentey@gmail.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230630073720.21297-11-shentey@gmail.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/pci-host/i440fx.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/hw/pci-host/i440fx.c b/hw/pci-host/i440fx.c
index b7c24a4..0b76fe7 100644
--- a/hw/pci-host/i440fx.c
+++ b/hw/pci-host/i440fx.c
@@ -205,28 +205,28 @@ static void i440fx_pcihost_get_pci_hole64_end(Object *obj, Visitor *v,
static void i440fx_pcihost_initfn(Object *obj)
{
- PCIHostState *s = PCI_HOST_BRIDGE(obj);
+ PCIHostState *phb = PCI_HOST_BRIDGE(obj);
- memory_region_init_io(&s->conf_mem, obj, &pci_host_conf_le_ops, s,
+ memory_region_init_io(&phb->conf_mem, obj, &pci_host_conf_le_ops, phb,
"pci-conf-idx", 4);
- memory_region_init_io(&s->data_mem, obj, &pci_host_data_le_ops, s,
+ memory_region_init_io(&phb->data_mem, obj, &pci_host_data_le_ops, phb,
"pci-conf-data", 4);
}
static void i440fx_pcihost_realize(DeviceState *dev, Error **errp)
{
- PCIHostState *s = PCI_HOST_BRIDGE(dev);
+ PCIHostState *phb = PCI_HOST_BRIDGE(dev);
SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
- memory_region_add_subregion(s->bus->address_space_io, 0xcf8, &s->conf_mem);
+ memory_region_add_subregion(phb->bus->address_space_io, 0xcf8, &phb->conf_mem);
sysbus_init_ioports(sbd, 0xcf8, 4);
- memory_region_add_subregion(s->bus->address_space_io, 0xcfc, &s->data_mem);
+ memory_region_add_subregion(phb->bus->address_space_io, 0xcfc, &phb->data_mem);
sysbus_init_ioports(sbd, 0xcfc, 4);
/* register i440fx 0xcf8 port as coalesced pio */
- memory_region_set_flush_coalesced(&s->data_mem);
- memory_region_add_coalescing(&s->conf_mem, 0, 4);
+ memory_region_set_flush_coalesced(&phb->data_mem);
+ memory_region_add_coalescing(&phb->conf_mem, 0, 4);
}
static void i440fx_realize(PCIDevice *dev, Error **errp)
@@ -248,17 +248,16 @@ PCIBus *i440fx_init(const char *pci_type,
MemoryRegion *pci_address_space,
MemoryRegion *ram_memory)
{
+ I440FXState *s = I440FX_PCI_HOST_BRIDGE(dev);
+ PCIHostState *phb = PCI_HOST_BRIDGE(dev);
PCIBus *b;
PCIDevice *d;
- PCIHostState *s;
PCII440FXState *f;
unsigned i;
- I440FXState *i440fx;
- s = PCI_HOST_BRIDGE(dev);
b = pci_root_bus_new(dev, NULL, pci_address_space,
address_space_io, 0, TYPE_PCI_BUS);
- s->bus = b;
+ phb->bus = b;
sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
d = pci_create_simple(b, 0, pci_type);
@@ -267,8 +266,7 @@ PCIBus *i440fx_init(const char *pci_type,
f->pci_address_space = pci_address_space;
f->ram_memory = ram_memory;
- i440fx = I440FX_PCI_HOST_BRIDGE(dev);
- range_set_bounds(&i440fx->pci_hole, below_4g_mem_size,
+ range_set_bounds(&s->pci_hole, below_4g_mem_size,
IO_APIC_DEFAULT_ADDRESS - 1);
/* setup pci memory mapping */