Skip to content

Commit 87d5403

Browse files
weiyufengbjorn-helgaas
authored andcommitted
PCI: cpqphp: Use PCI_POSSIBLE_ERROR() to check config reads
Use PCI_POSSIBLE_ERROR() to check the response we get when we read data from hardware. This unifies PCI error response checking and makes error checks consistent and easier to find. Link: https://lore.kernel.org/r/20240806065050.28725-1-412574090@163.com Signed-off-by: weiyufeng <weiyufeng@kylinos.cn> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
1 parent 5d8491a commit 87d5403

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/pci/hotplug/cpqphp_pci.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ static int PCI_RefinedAccessConfig(struct pci_bus *bus, unsigned int devfn, u8 o
138138

139139
if (pci_bus_read_config_dword(bus, devfn, PCI_VENDOR_ID, &vendID) == -1)
140140
return -1;
141-
if (vendID == 0xffffffff)
141+
if (PCI_POSSIBLE_ERROR(vendID))
142142
return -1;
143143
return pci_bus_read_config_dword(bus, devfn, offset, value);
144144
}
@@ -253,7 +253,7 @@ static int PCI_GetBusDevHelper(struct controller *ctrl, u8 *bus_num, u8 *dev_num
253253
*dev_num = tdevice;
254254
ctrl->pci_bus->number = tbus;
255255
pci_bus_read_config_dword(ctrl->pci_bus, *dev_num, PCI_VENDOR_ID, &work);
256-
if (!nobridge || (work == 0xffffffff))
256+
if (!nobridge || PCI_POSSIBLE_ERROR(work))
257257
return 0;
258258

259259
dbg("bus_num %d devfn %d\n", *bus_num, *dev_num);

0 commit comments

Comments
 (0)