[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 3/3] 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@xxxxxxxx>

--- a/drivers/xen/xen-pciback/vpci.c
+++ b/drivers/xen/xen-pciback/vpci.c
@@ -235,7 +235,6 @@ static int __xen_pcibk_get_pcifront_dev(
                                        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;
 
@@ -244,11 +243,7 @@ static int __xen_pcibk_get_pcifront_dev(
                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;




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.