Skip to content

Commit

Permalink
xen-pciback: simplify determination of 64-bit memory resource
Browse files Browse the repository at this point in the history
Other than for raw BAR values, flags are properly separated in the
internal representation.

Signed-off-by: Jan Beulich <[email protected]>
Signed-off-by: David Vrabel <[email protected]>
  • Loading branch information
jbeulich authored and David Vrabel committed Jul 6, 2016
1 parent 6ad2655 commit c8670c2
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/xen/xen-pciback/conf_space_header.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c8670c2

Please sign in to comment.