On Tue, Sep 01, 2020 at 12:40:41PM +0200, Philippe Mathieu-Daudé wrote:
> Replace the magic '4' by ARRAY_SIZE(s->irq) which is more explicit.
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4...@amsat.org>

Acked-by: David Gibson <da...@gibson.dropbear.id.au>

> ---
>  hw/ppc/ppc4xx_pci.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/ppc/ppc4xx_pci.c b/hw/ppc/ppc4xx_pci.c
> index 3ea47df71fe..cd3f192a138 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");

-- 
David Gibson                    | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
                                | _way_ _around_!
http://www.ozlabs.org/~dgibson

Attachment: signature.asc
Description: PGP signature

Reply via email to