diff options
author | Jan Beulich <jbeulich@suse.com> | 2021-04-07 16:37:58 +0200 |
---|---|---|
committer | Juergen Gross <jgross@suse.com> | 2021-04-23 09:53:24 +0200 |
commit | a929e124060c448b367f56b28a0c118876147b1f (patch) | |
tree | 0b32fbf3168b7c9ecbbf25e0d5850be0af1b273f /drivers/xen | |
parent | ec3307a5bb6823bd687a660c1ece9b271e0b1288 (diff) | |
download | linux-a929e124060c448b367f56b28a0c118876147b1f.tar.gz linux-a929e124060c448b367f56b28a0c118876147b1f.tar.bz2 linux-a929e124060c448b367f56b28a0c118876147b1f.zip |
xen-pciback: simplify vpci's find hook
There's no point in comparing SBDF - we can simply compare the struct
pci_dev pointers. If they weren't the same for a given device, we'd have
bigger problems from having stored a stale pointer.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Link: https://lore.kernel.org/r/158273a2-d1b9-3545-b25d-affca867376c@suse.com
Signed-off-by: Juergen Gross <jgross@suse.com>
Diffstat (limited to 'drivers/xen')
-rw-r--r-- | drivers/xen/xen-pciback/vpci.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/xen/xen-pciback/vpci.c b/drivers/xen/xen-pciback/vpci.c index 5447b5ab7c76..4162d0e7e00d 100644 --- a/drivers/xen/xen-pciback/vpci.c +++ b/drivers/xen/xen-pciback/vpci.c @@ -233,7 +233,6 @@ static int __xen_pcibk_get_pcifront_dev(struct pci_dev *pcidev, unsigned int *devfn) { struct pci_dev_entry *entry; - struct pci_dev *dev = NULL; struct vpci_dev_data *vpci_dev = pdev->pci_dev_data; int found = 0, slot; @@ -242,11 +241,7 @@ static int __xen_pcibk_get_pcifront_dev(struct pci_dev *pcidev, list_for_each_entry(entry, &vpci_dev->dev_list[slot], list) { - dev = entry->dev; - if (dev && dev->bus->number == pcidev->bus->number - && pci_domain_nr(dev->bus) == - pci_domain_nr(pcidev->bus) - && dev->devfn == pcidev->devfn) { + if (entry->dev == pcidev) { found = 1; *domain = 0; *bus = 0; |