xen-pciback: simplify determination of 64-bit memory resource
authorJan Beulich <JBeulich@suse.com>
Wed, 6 Jul 2016 06:58:19 +0000 (00:58 -0600)
committerDavid Vrabel <david.vrabel@citrix.com>
Wed, 6 Jul 2016 09:35:37 +0000 (10:35 +0100)
Other than for raw BAR values, flags are properly separated in the
internal representation.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
drivers/xen/xen-pciback/conf_space_header.c

index 56647b8736976613af50ebaa05129b11a9fd9123..bfa610d02443668e5d5b148e5b2948e33db000d5 100644 (file)
@@ -222,10 +222,7 @@ static void *bar_init(struct pci_dev *dev, int offset)
                pos = PCI_ROM_RESOURCE;
        else {
                pos = (offset - PCI_BASE_ADDRESS_0) / 4;
-               if (pos && ((res[pos - 1].flags & (PCI_BASE_ADDRESS_SPACE |
-                               PCI_BASE_ADDRESS_MEM_TYPE_MASK)) ==
-                          (PCI_BASE_ADDRESS_SPACE_MEMORY |
-                               PCI_BASE_ADDRESS_MEM_TYPE_64))) {
+               if (pos && (res[pos - 1].flags & IORESOURCE_MEM_64)) {
                        bar->val = res[pos - 1].start >> 32;
                        bar->len_val = -resource_size(&res[pos - 1]) >> 32;
                        return bar;