Skip to content

Commit 0e8207f

Browse files
Zhengzengkaibjorn-helgaas
authored andcommitted
PCI/P2PDMA: 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 from dev->bus->number and dev->devfn. [bhelgaas: commit log] Link: https://lore.kernel.org/r/20230811111057.31900-1-zhengzengkai@huawei.com Signed-off-by: Zheng Zengkai <zhengzengkai@huawei.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Logan Gunthorpe <logang@deltatee.com>
1 parent 6f7dc30 commit 0e8207f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/pci/p2pdma.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -532,8 +532,7 @@ static bool host_bridge_whitelist(struct pci_dev *a, struct pci_dev *b,
532532

533533
static unsigned long map_types_idx(struct pci_dev *client)
534534
{
535-
return (pci_domain_nr(client->bus) << 16) |
536-
(client->bus->number << 8) | client->devfn;
535+
return (pci_domain_nr(client->bus) << 16) | pci_dev_id(client);
537536
}
538537

539538
/*

0 commit comments

Comments
 (0)