Commit a929e124 authored by Jan Beulich's avatar Jan Beulich Committed by Juergen Gross

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: default avatarJan Beulich <jbeulich@suse.com>
Reviewed-by: default avatarBoris Ostrovsky <boris.ostrovsky@oracle.com>

Link: https://lore.kernel.org/r/158273a2-d1b9-3545-b25d-affca867376c@suse.comSigned-off-by: default avatarJuergen Gross <jgross@suse.com>
parent ec3307a5
...@@ -233,7 +233,6 @@ static int __xen_pcibk_get_pcifront_dev(struct pci_dev *pcidev, ...@@ -233,7 +233,6 @@ static int __xen_pcibk_get_pcifront_dev(struct pci_dev *pcidev,
unsigned int *devfn) unsigned int *devfn)
{ {
struct pci_dev_entry *entry; struct pci_dev_entry *entry;
struct pci_dev *dev = NULL;
struct vpci_dev_data *vpci_dev = pdev->pci_dev_data; struct vpci_dev_data *vpci_dev = pdev->pci_dev_data;
int found = 0, slot; int found = 0, slot;
...@@ -242,11 +241,7 @@ static int __xen_pcibk_get_pcifront_dev(struct pci_dev *pcidev, ...@@ -242,11 +241,7 @@ static int __xen_pcibk_get_pcifront_dev(struct pci_dev *pcidev,
list_for_each_entry(entry, list_for_each_entry(entry,
&vpci_dev->dev_list[slot], &vpci_dev->dev_list[slot],
list) { list) {
dev = entry->dev; if (entry->dev == pcidev) {
if (dev && dev->bus->number == pcidev->bus->number
&& pci_domain_nr(dev->bus) ==
pci_domain_nr(pcidev->bus)
&& dev->devfn == pcidev->devfn) {
found = 1; found = 1;
*domain = 0; *domain = 0;
*bus = 0; *bus = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment