diff options
author | Zheng Zengkai <zhengzengkai@huawei.com> | 2023-08-11 13:10:57 +0200 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2023-08-14 19:05:05 +0200 |
commit | 0e8207f54cf5902367080a0e648d3adae6c019a1 (patch) | |
tree | 69b06b4e579d7a6f2b5bb139dd46f7e5b02c67d9 /drivers/pci | |
parent | PCI/IOV: Use pci_dev_id() to simplify the code (diff) | |
download | linux-0e8207f54cf5902367080a0e648d3adae6c019a1.tar.xz linux-0e8207f54cf5902367080a0e648d3adae6c019a1.zip |
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>
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/p2pdma.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/pci/p2pdma.c b/drivers/pci/p2pdma.c index 6cd98ffca198..ec04d0ed157b 100644 --- a/drivers/pci/p2pdma.c +++ b/drivers/pci/p2pdma.c @@ -532,8 +532,7 @@ static bool host_bridge_whitelist(struct pci_dev *a, struct pci_dev *b, static unsigned long map_types_idx(struct pci_dev *client) { - return (pci_domain_nr(client->bus) << 16) | - (client->bus->number << 8) | client->devfn; + return (pci_domain_nr(client->bus) << 16) | pci_dev_id(client); } /* |