[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 7/7] hw/ide/piix: Remove dead code in pci_piix_init_ports()
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 7/7] hw/ide/piix: Remove dead code in pci_piix_init_ports() |
Date: |
Wed, 8 Feb 2023 01:07:43 +0100 |
pci_piix_init_ports() always return '0' so can't fail.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/ide/piix.c | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/hw/ide/piix.c b/hw/ide/piix.c
index 1cd4389611..54d545ce3a 100644
--- a/hw/ide/piix.c
+++ b/hw/ide/piix.c
@@ -126,7 +126,7 @@ static void piix_ide_reset(DeviceState *dev)
pci_set_byte(pci_conf + 0x20, 0x01); /* BMIBA: 20-23h */
}
-static int pci_piix_init_ports(PCIIDEState *d)
+static void pci_piix_init_ports(PCIIDEState *d)
{
static const struct {
int iobase;
@@ -149,15 +149,12 @@ static int pci_piix_init_ports(PCIIDEState *d)
d->bmdma[i].bus = &d->bus[i];
ide_register_restart_cb(&d->bus[i]);
}
-
- return 0;
}
static void pci_piix_ide_realize(PCIDevice *dev, Error **errp)
{
PCIIDEState *d = PCI_IDE(dev);
uint8_t *pci_conf = dev->config;
- int rc;
pci_conf[PCI_CLASS_PROG] = 0x80; // legacy ATA mode
@@ -166,11 +163,7 @@ static void pci_piix_ide_realize(PCIDevice *dev, Error
**errp)
vmstate_register(VMSTATE_IF(dev), 0, &vmstate_ide_pci, d);
- rc = pci_piix_init_ports(d);
- if (rc) {
- error_setg_errno(errp, -rc, "Failed to realize %s",
- object_get_typename(OBJECT(dev)));
- }
+ pci_piix_init_ports(d);
}
static void pci_piix_ide_exitfn(PCIDevice *dev)
--
2.38.1
- Re: [PATCH 6/7] hw/isa: Assert isa_register_portio_list() gets non-NULL ISA device, (continued)
[PATCH 5/7] hw/ide/piix: Use generic ide_init_ioport(), Philippe Mathieu-Daudé, 2023/02/07
[PATCH 4/7] hw/ide: Introduce generic ide_init_ioport(), Philippe Mathieu-Daudé, 2023/02/07
[PATCH 7/7] hw/ide/piix: Remove dead code in pci_piix_init_ports(),
Philippe Mathieu-Daudé <=
Re: [PATCH 0/7] hw/ide: Untangle ISA/PCI abuses of ide_init_ioport(), Philippe Mathieu-Daudé, 2023/02/07