Commit f7f7c3d6 authored by Xiongfeng Wang's avatar Xiongfeng Wang Committed by Bjorn Helgaas
Browse files

PCI/AER: Use pci_dev_id() to simplify the code

When we have a struct pci_dev *, use pci_dev_id() instead of manually
composing the ID with PCI_DEVID() from dev->bus->number and dev->devfn.

[bhelgaas: commit log]
Link: https://lore.kernel.org/r/20230807134858.116051-3-wangxiongfeng2@huawei.com


Signed-off-by: default avatarXiongfeng Wang <wangxiongfeng2@huawei.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
parent d332642a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -712,7 +712,7 @@ static void __aer_print_error(struct pci_dev *dev,
void aer_print_error(struct pci_dev *dev, struct aer_err_info *info)
{
	int layer, agent;
	int id = ((dev->bus->number << 8) | dev->devfn);
	int id = pci_dev_id(dev);
	const char *level;

	if (!info->status) {
@@ -847,7 +847,7 @@ static bool is_error_source(struct pci_dev *dev, struct aer_err_info *e_info)
	if ((PCI_BUS_NUM(e_info->id) != 0) &&
	    !(dev->bus->bus_flags & PCI_BUS_FLAGS_NO_AERSID)) {
		/* Device ID match? */
		if (e_info->id == ((dev->bus->number << 8) | dev->devfn))
		if (e_info->id == pci_dev_id(dev))
			return true;

		/* Continue id comparing if there is no multiple error */