[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 04/17] ahci: Omit errp for pci_add_capability
From: |
Akihiko Odaki |
Subject: |
[PATCH v4 04/17] ahci: Omit errp for pci_add_capability |
Date: |
Thu, 27 Oct 2022 15:36:52 +0900 |
Omitting errp for pci_add_capability() causes it to abort if
capabilities overlap. This behavior is appropriate here because all of
the capabilities set in this device are defined in the program and
their overlap should not happen unless there is a programming error.
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
hw/ide/ich.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/hw/ide/ich.c b/hw/ide/ich.c
index 1007a51fcb..3b478b01f8 100644
--- a/hw/ide/ich.c
+++ b/hw/ide/ich.c
@@ -106,7 +106,7 @@ static void pci_ich9_ahci_init(Object *obj)
static void pci_ich9_ahci_realize(PCIDevice *dev, Error **errp)
{
struct AHCIPCIState *d;
- int sata_cap_offset;
+ uint8_t sata_cap_offset;
uint8_t *sata_cap;
d = ICH9_AHCI(dev);
int ret;
@@ -130,11 +130,7 @@ static void pci_ich9_ahci_realize(PCIDevice *dev, Error
**errp)
&d->ahci.mem);
sata_cap_offset = pci_add_capability(dev, PCI_CAP_ID_SATA,
- ICH9_SATA_CAP_OFFSET, SATA_CAP_SIZE,
- errp);
- if (sata_cap_offset < 0) {
- return;
- }
+ ICH9_SATA_CAP_OFFSET, SATA_CAP_SIZE);
sata_cap = dev->config + sata_cap_offset;
pci_set_word(sata_cap + SATA_CAP_REV, 0x10);
--
2.37.3
- [PATCH v4 00/17] pci: Abort if pci_add_capability fails, Akihiko Odaki, 2022/10/27
- [PATCH v4 01/17] hw/vfio/pci: Ensure MSI and MSI-X do not overlap, Akihiko Odaki, 2022/10/27
- [PATCH v4 02/17] pci: Allow to omit errp for pci_add_capability, Akihiko Odaki, 2022/10/27
- [PATCH v4 03/17] hw/i386/amd_iommu: Omit errp for pci_add_capability, Akihiko Odaki, 2022/10/27
- [PATCH v4 05/17] e1000e: Omit errp for pci_add_capability, Akihiko Odaki, 2022/10/27
- [PATCH v4 07/17] hw/nvme: Omit errp for pci_add_capability, Akihiko Odaki, 2022/10/27
- [PATCH v4 11/17] pci/shpc: Omit errp for pci_add_capability, Akihiko Odaki, 2022/10/27
- [PATCH v4 06/17] eepro100: Omit errp for pci_add_capability, Akihiko Odaki, 2022/10/27
- [PATCH v4 04/17] ahci: Omit errp for pci_add_capability,
Akihiko Odaki <=
- [PATCH v4 10/17] pcie: Omit errp for pci_add_capability, Akihiko Odaki, 2022/10/27
- [PATCH v4 13/17] pci/slotid: Omit errp for pci_add_capability, Akihiko Odaki, 2022/10/27
- [PATCH v4 12/17] msix: Omit errp for pci_add_capability, Akihiko Odaki, 2022/10/27
- [PATCH v4 15/17] hw/vfio/pci: Omit errp for pci_add_capability, Akihiko Odaki, 2022/10/27
- [PATCH v4 09/17] hw/pci/pci_bridge: Omit errp for pci_add_capability, Akihiko Odaki, 2022/10/27
- [PATCH v4 08/17] msi: Omit errp for pci_add_capability, Akihiko Odaki, 2022/10/27
- [PATCH v4 14/17] hw/pci-bridge/pcie_pci_bridge: Omit errp for pci_add_capability, Akihiko Odaki, 2022/10/27
- [PATCH v4 16/17] virtio-pci: Omit errp for pci_add_capability, Akihiko Odaki, 2022/10/27
- [PATCH v4 17/17] pci: Remove legacy errp from pci_add_capability, Akihiko Odaki, 2022/10/27