Skip to content

Commit f7f7c3d

Browse files
fenghusthubjorn-helgaas
authored andcommitted
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: Xiongfeng Wang <wangxiongfeng2@huawei.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
1 parent d332642 commit f7f7c3d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/pci/pcie/aer.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ static void __aer_print_error(struct pci_dev *dev,
712712
void aer_print_error(struct pci_dev *dev, struct aer_err_info *info)
713713
{
714714
int layer, agent;
715-
int id = ((dev->bus->number << 8) | dev->devfn);
715+
int id = pci_dev_id(dev);
716716
const char *level;
717717

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

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

0 commit comments

Comments
 (0)