Skip to content

Commit f40bd28

Browse files
committed
PCI/AER: Extract bus/dev/fn in aer_print_port_info() with PCI_BUS_NUM(), etc
Use PCI_BUS_NUM(), PCI_SLOT(), PCI_FUNC() to extract the bus number, device, and function number directly from the Error Source ID. There's no need to shift and mask it explicitly. Signed-off-by: Bjorn Helgaas <[email protected]> Tested-by: Krzysztof Wilczyński <[email protected]> Reviewed-by: Kuppuswamy Sathyanarayanan <[email protected]> Reviewed-by: Ilpo Järvinen <[email protected]> Reviewed-by: Jonathan Cameron <[email protected]> Link: https://patch.msgid.link/[email protected]
1 parent 6a1eda7 commit f40bd28

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/pci/pcie/aer.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -736,14 +736,14 @@ void aer_print_error(struct pci_dev *dev, struct aer_err_info *info)
736736
static void aer_print_port_info(struct pci_dev *dev, struct aer_err_info *info,
737737
bool found)
738738
{
739-
u8 bus = info->id >> 8;
740-
u8 devfn = info->id & 0xff;
739+
u16 source = info->id;
741740

742741
pci_info(dev, "%s%s error message received from %04x:%02x:%02x.%d%s\n",
743742
info->multi_error_valid ? "Multiple " : "",
744743
aer_error_severity_string[info->severity],
745-
pci_domain_nr(dev->bus), bus, PCI_SLOT(devfn),
746-
PCI_FUNC(devfn), found ? "" : " (no details found");
744+
pci_domain_nr(dev->bus), PCI_BUS_NUM(source),
745+
PCI_SLOT(source), PCI_FUNC(source),
746+
found ? "" : " (no details found");
747747
}
748748

749749
#ifdef CONFIG_ACPI_APEI_PCIEAER

0 commit comments

Comments
 (0)