Commit 022edd86 authored by Zhao, Yu's avatar Zhao, Yu Committed by Jesse Barnes

PCI: use resource_size() everywhere.

This is a cleanup that replaces the resource calculation formula with
resource_size().
Signed-off-by: default avatarYu Zhao <yu.zhao@intel.com>
Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
parent c322b28a
...@@ -299,7 +299,7 @@ static void pbus_size_io(struct pci_bus *bus) ...@@ -299,7 +299,7 @@ static void pbus_size_io(struct pci_bus *bus)
if (r->parent || !(r->flags & IORESOURCE_IO)) if (r->parent || !(r->flags & IORESOURCE_IO))
continue; continue;
r_size = r->end - r->start + 1; r_size = resource_size(r);
if (r_size < 0x400) if (r_size < 0x400)
/* Might be re-aligned for ISA */ /* Might be re-aligned for ISA */
...@@ -350,7 +350,7 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask, unsigned long ...@@ -350,7 +350,7 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask, unsigned long
if (r->parent || (r->flags & mask) != type) if (r->parent || (r->flags & mask) != type)
continue; continue;
r_size = r->end - r->start + 1; r_size = resource_size(r);
/* For bridges size != alignment */ /* For bridges size != alignment */
align = resource_alignment(r); align = resource_alignment(r);
order = __ffs(align) - 20; order = __ffs(align) - 20;
......
...@@ -129,7 +129,7 @@ int pci_assign_resource(struct pci_dev *dev, int resno) ...@@ -129,7 +129,7 @@ int pci_assign_resource(struct pci_dev *dev, int resno)
resource_size_t size, min, align; resource_size_t size, min, align;
int ret; int ret;
size = res->end - res->start + 1; size = resource_size(res);
min = (res->flags & IORESOURCE_IO) ? PCIBIOS_MIN_IO : PCIBIOS_MIN_MEM; min = (res->flags & IORESOURCE_IO) ? PCIBIOS_MIN_IO : PCIBIOS_MIN_MEM;
align = resource_alignment(res); align = resource_alignment(res);
......
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