diff options
author | Zhao, Yu <yu.zhao@intel.com> | 2008-10-13 07:24:28 -0400 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2008-10-20 13:54:28 -0400 |
commit | 022edd86d7c864bc8fadc3c8ac4e6a464472ab05 (patch) | |
tree | 6495a6f473837f1c880c052d76ff9358de76297d | |
parent | c322b28a04c084a467a862766f74c40c917a721c (diff) |
PCI: use resource_size() everywhere.
This is a cleanup that replaces the resource calculation formula with
resource_size().
Signed-off-by: Yu Zhao <yu.zhao@intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
-rw-r--r-- | drivers/pci/setup-bus.c | 4 | ||||
-rw-r--r-- | drivers/pci/setup-res.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index 471a429d7a20..ea979f2bc6db 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup-bus.c | |||
@@ -299,7 +299,7 @@ static void pbus_size_io(struct pci_bus *bus) | |||
299 | 299 | ||
300 | if (r->parent || !(r->flags & IORESOURCE_IO)) | 300 | if (r->parent || !(r->flags & IORESOURCE_IO)) |
301 | continue; | 301 | continue; |
302 | r_size = r->end - r->start + 1; | 302 | r_size = resource_size(r); |
303 | 303 | ||
304 | if (r_size < 0x400) | 304 | if (r_size < 0x400) |
305 | /* Might be re-aligned for ISA */ | 305 | /* 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 | 350 | ||
351 | if (r->parent || (r->flags & mask) != type) | 351 | if (r->parent || (r->flags & mask) != type) |
352 | continue; | 352 | continue; |
353 | r_size = r->end - r->start + 1; | 353 | r_size = resource_size(r); |
354 | /* For bridges size != alignment */ | 354 | /* For bridges size != alignment */ |
355 | align = resource_alignment(r); | 355 | align = resource_alignment(r); |
356 | order = __ffs(align) - 20; | 356 | order = __ffs(align) - 20; |
diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c index d4b5c690eaa7..2dbd96cce2d8 100644 --- a/drivers/pci/setup-res.c +++ b/drivers/pci/setup-res.c | |||
@@ -129,7 +129,7 @@ int pci_assign_resource(struct pci_dev *dev, int resno) | |||
129 | resource_size_t size, min, align; | 129 | resource_size_t size, min, align; |
130 | int ret; | 130 | int ret; |
131 | 131 | ||
132 | size = res->end - res->start + 1; | 132 | size = resource_size(res); |
133 | min = (res->flags & IORESOURCE_IO) ? PCIBIOS_MIN_IO : PCIBIOS_MIN_MEM; | 133 | min = (res->flags & IORESOURCE_IO) ? PCIBIOS_MIN_IO : PCIBIOS_MIN_MEM; |
134 | 134 | ||
135 | align = resource_alignment(res); | 135 | align = resource_alignment(res); |