diff options
author | Philippe Mathieu-Daudé | 2020-09-01 12:40:41 +0200 |
---|---|---|
committer | David Gibson | 2020-09-08 02:08:43 +0200 |
commit | 4192920cbc962770d54cd932748f913a7b1fe3c7 (patch) | |
tree | c155d807ab4f2c831cefe190de733424dd226264 | |
parent | target/s390x: Use start-powered-off CPUState property (diff) | |
download | qemu-4192920cbc962770d54cd932748f913a7b1fe3c7.tar.gz qemu-4192920cbc962770d54cd932748f913a7b1fe3c7.tar.xz qemu-4192920cbc962770d54cd932748f913a7b1fe3c7.zip |
hw/ppc/ppc4xx_pci: Use ARRAY_SIZE() instead of magic value
Replace the magic '4' by ARRAY_SIZE(s->irq) which is more explicit.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20200901104043.91383-4-f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
-rw-r--r-- | hw/ppc/ppc4xx_pci.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/ppc/ppc4xx_pci.c b/hw/ppc/ppc4xx_pci.c index 3ea47df71f..cd3f192a13 100644 --- a/hw/ppc/ppc4xx_pci.c +++ b/hw/ppc/ppc4xx_pci.c @@ -320,7 +320,8 @@ static void ppc4xx_pcihost_realize(DeviceState *dev, Error **errp) b = pci_register_root_bus(dev, NULL, ppc4xx_pci_set_irq, ppc4xx_pci_map_irq, s->irq, get_system_memory(), - get_system_io(), 0, 4, TYPE_PCI_BUS); + get_system_io(), 0, ARRAY_SIZE(s->irq), + TYPE_PCI_BUS); h->bus = b; pci_create_simple(b, 0, "ppc4xx-host-bridge"); |