]> git.proxmox.com Git - mirror_qemu.git/commitdiff
hw/ppc/ppc4xx_pci: Replace pointless warning by assert()
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>
Tue, 1 Sep 2020 10:40:42 +0000 (12:40 +0200)
committerDavid Gibson <david@gibson.dropbear.id.au>
Tue, 8 Sep 2020 00:08:43 +0000 (10:08 +1000)
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>
Message-Id: <20200901104043.91383-5-f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/ppc/ppc4xx_pci.c

index cd3f192a13873a9d3a831e1a56780cee70f15916..503ef46b39af09443bbde12d86169c8710591b1d 100644 (file)
@@ -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);
 }