]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
PCI: use resource_size() everywhere.
authorZhao, Yu <yu.zhao@intel.com>
Mon, 13 Oct 2008 11:24:28 +0000 (19:24 +0800)
committerJesse Barnes <jbarnes@virtuousgeek.org>
Mon, 20 Oct 2008 17:54:28 +0000 (10:54 -0700)
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>
drivers/pci/setup-bus.c
drivers/pci/setup-res.c

index 471a429d7a20fec7b116537ed5e90c912da8b7b7..ea979f2bc6db0ecdc6f6c355e9926c59f908cfd7 100644 (file)
@@ -299,7 +299,7 @@ static void pbus_size_io(struct pci_bus *bus)
 
                        if (r->parent || !(r->flags & IORESOURCE_IO))
                                continue;
-                       r_size = r->end - r->start + 1;
+                       r_size = resource_size(r);
 
                        if (r_size < 0x400)
                                /* Might be re-aligned for ISA */
@@ -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)
                                continue;
-                       r_size = r->end - r->start + 1;
+                       r_size = resource_size(r);
                        /* For bridges size != alignment */
                        align = resource_alignment(r);
                        order = __ffs(align) - 20;
index d4b5c690eaa776112c46cc8f9ca993a49e233d50..2dbd96cce2d8469e82198ec3d29ae3604ef104de 100644 (file)
@@ -129,7 +129,7 @@ int pci_assign_resource(struct pci_dev *dev, int resno)
        resource_size_t size, min, align;
        int ret;
 
-       size = res->end - res->start + 1;
+       size = resource_size(res);
        min = (res->flags & IORESOURCE_IO) ? PCIBIOS_MIN_IO : PCIBIOS_MIN_MEM;
 
        align = resource_alignment(res);