Commit 0e8207f5 authored by Zheng Zengkai's avatar Zheng Zengkai Committed by Bjorn Helgaas
Browse files

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: default avatarZheng Zengkai <zhengzengkai@huawei.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Reviewed-by: default avatarLogan Gunthorpe <logang@deltatee.com>
parent 6f7dc307
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -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);
}

/*