[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 4/5] hw/ppc/ppc4xx_pci: Replace pointless warning by assert()
From: |
David Gibson |
Subject: |
Re: [PATCH 4/5] hw/ppc/ppc4xx_pci: Replace pointless warning by assert() |
Date: |
Wed, 2 Sep 2020 11:17:08 +1000 |
On Tue, Sep 01, 2020 at 12:40:42PM +0200, Philippe Mathieu-Daudé wrote:
> We call pci_register_root_bus() to register 4 IRQs with the
> ppc4xx_pci_set_irq() handler. As it can only be called with
> values in the [0-4[ range, replace the pointless warning by
> an assert().
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
> ---
> hw/ppc/ppc4xx_pci.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/hw/ppc/ppc4xx_pci.c b/hw/ppc/ppc4xx_pci.c
> index cd3f192a138..503ef46b39a 100644
> --- a/hw/ppc/ppc4xx_pci.c
> +++ b/hw/ppc/ppc4xx_pci.c
> @@ -256,10 +256,7 @@ static void ppc4xx_pci_set_irq(void *opaque, int
> irq_num, int level)
> qemu_irq *pci_irqs = opaque;
>
> trace_ppc4xx_pci_set_irq(irq_num);
> - if (irq_num < 0) {
> - fprintf(stderr, "%s: PCI irq %d\n", __func__, irq_num);
> - return;
> - }
> + assert(irq_num >= 0);
> qemu_set_irq(pci_irqs[irq_num], level);
> }
>
--
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
signature.asc
Description: PGP signature
- Re: [PATCH 2/5] hw/mips/fuloong2e: Convert pointless error message to an assert(), (continued)