mbox series

[v2,0/2] hw: Replace some impossible checks by assertions

Message ID 20200910072325.439344-1-f4bug@amsat.org
Headers show
Series hw: Replace some impossible checks by assertions | expand

Message

Philippe Mathieu-Daudé Sept. 10, 2020, 7:23 a.m. UTC
Trivial patches removing unreachable code.

Since v1:
- dropped patches queued
- replace dead code by assert (Peter)
- use PCI_NUM_PINS definition (Cédric)

Philippe Mathieu-Daudé (2):
  hw/gpio/max7310: Remove impossible check
  hw/ppc/ppc4xx_pci: Replace magic value by the PCI_NUM_PINS definition

 hw/gpio/max7310.c   | 5 +----
 hw/ppc/ppc4xx_pci.c | 2 +-
 2 files changed, 2 insertions(+), 5 deletions(-)

Comments

David Gibson Sept. 10, 2020, 7:43 a.m. UTC | #1
On Thu, Sep 10, 2020 at 09:23:25AM +0200, Philippe Mathieu-Daudé wrote:
> Replace the magic '4' value by the PCI_NUM_PINS definition.
> 
> Suggested-by: Cédric Le Goater <clg@kaod.org>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

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

> ---
>  hw/ppc/ppc4xx_pci.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/ppc/ppc4xx_pci.c b/hw/ppc/ppc4xx_pci.c
> index 503ef46b39a..930be78361d 100644
> --- a/hw/ppc/ppc4xx_pci.c
> +++ b/hw/ppc/ppc4xx_pci.c
> @@ -54,7 +54,7 @@ struct PPC4xxPCIState {
>  
>      struct PCIMasterMap pmm[PPC4xx_PCI_NR_PMMS];
>      struct PCITargetMap ptm[PPC4xx_PCI_NR_PTMS];
> -    qemu_irq irq[4];
> +    qemu_irq irq[PCI_NUM_PINS];
>  
>      MemoryRegion container;
>      MemoryRegion iomem;