@@ -209,21 +209,18 @@ static int bar_read(struct pci_dev *dev,
return 0;
}
-static inline void read_dev_bar(struct pci_dev *dev,
- struct pci_bar_info *bar_info, int offset,
- u32 len_mask)
+static inline void read_dev_bar(const struct pci_dev *dev,
+ struct pci_bar_info *bar_info,
+ unsigned int offset)
{
- int pos;
- struct resource *res = dev->resource;
+ unsigned int pos;
+ const struct resource *res = dev->resource;
if (offset == PCI_ROM_ADDRESS || offset == PCI_ROM_ADDRESS1)
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_info->val = res[pos - 1].start >> 32;
bar_info->len_val = -resource_size(&res[pos - 1]) >> 32;
return;
@@ -248,7 +245,7 @@ static void *bar_init(struct pci_dev *de
if (!bar)
return ERR_PTR(-ENOMEM);
- read_dev_bar(dev, bar, offset, ~0);
+ read_dev_bar(dev, bar, offset);
return bar;
}
@@ -260,7 +257,7 @@ static void *rom_init(struct pci_dev *de
if (!bar)
return ERR_PTR(-ENOMEM);
- read_dev_bar(dev, bar, offset, ~PCI_ROM_ADDRESS_ENABLE);
+ read_dev_bar(dev, bar, offset);
return bar;
}
- drop unused function parameter - simplify determination of 64-bit memory resource - use const and unsigned Signed-off-by: Jan Beulich <jbeulich@suse.com> --- drivers/xen/xen-pciback/conf_space_header.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-)