aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2011-06-09 12:13:32 -0400
committerJiri Kosina <jkosina@suse.cz>2011-06-10 08:55:36 -0400
commit28f65c11f2ffb3957259dece647a24f8ad2e241b (patch)
tree6b7621d09d10df89eedd908d4506fb9f457a909f /drivers/pci
parent140a1ef2f91a00e1d25f0878c193abdc25bf6ebe (diff)
treewide: Convert uses of struct resource to resource_size(ptr)
Several fixes as well where the +1 was missing. Done via coccinelle scripts like: @@ struct resource *ptr; @@ - ptr->end - ptr->start + 1 + resource_size(ptr) and some grep and typing. Mostly uncompiled, no cross-compilers. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/hotplug/shpchp_sysfs.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/drivers/pci/hotplug/shpchp_sysfs.c b/drivers/pci/hotplug/shpchp_sysfs.c
index 071b7dc0094b..efa30da1ae8f 100644
--- a/drivers/pci/hotplug/shpchp_sysfs.c
+++ b/drivers/pci/hotplug/shpchp_sysfs.c
@@ -50,29 +50,26 @@ static ssize_t show_ctrl (struct device *dev, struct device_attribute *attr, cha
50 pci_bus_for_each_resource(bus, res, index) { 50 pci_bus_for_each_resource(bus, res, index) {
51 if (res && (res->flags & IORESOURCE_MEM) && 51 if (res && (res->flags & IORESOURCE_MEM) &&
52 !(res->flags & IORESOURCE_PREFETCH)) { 52 !(res->flags & IORESOURCE_PREFETCH)) {
53 out += sprintf(out, "start = %8.8llx, " 53 out += sprintf(out, "start = %8.8llx, length = %8.8llx\n",
54 "length = %8.8llx\n", 54 (unsigned long long)res->start,
55 (unsigned long long)res->start, 55 (unsigned long long)resource_size(res));
56 (unsigned long long)(res->end - res->start));
57 } 56 }
58 } 57 }
59 out += sprintf(out, "Free resources: prefetchable memory\n"); 58 out += sprintf(out, "Free resources: prefetchable memory\n");
60 pci_bus_for_each_resource(bus, res, index) { 59 pci_bus_for_each_resource(bus, res, index) {
61 if (res && (res->flags & IORESOURCE_MEM) && 60 if (res && (res->flags & IORESOURCE_MEM) &&
62 (res->flags & IORESOURCE_PREFETCH)) { 61 (res->flags & IORESOURCE_PREFETCH)) {
63 out += sprintf(out, "start = %8.8llx, " 62 out += sprintf(out, "start = %8.8llx, length = %8.8llx\n",
64 "length = %8.8llx\n", 63 (unsigned long long)res->start,
65 (unsigned long long)res->start, 64 (unsigned long long)resource_size(res));
66 (unsigned long long)(res->end - res->start));
67 } 65 }
68 } 66 }
69 out += sprintf(out, "Free resources: IO\n"); 67 out += sprintf(out, "Free resources: IO\n");
70 pci_bus_for_each_resource(bus, res, index) { 68 pci_bus_for_each_resource(bus, res, index) {
71 if (res && (res->flags & IORESOURCE_IO)) { 69 if (res && (res->flags & IORESOURCE_IO)) {
72 out += sprintf(out, "start = %8.8llx, " 70 out += sprintf(out, "start = %8.8llx, length = %8.8llx\n",
73 "length = %8.8llx\n", 71 (unsigned long long)res->start,
74 (unsigned long long)res->start, 72 (unsigned long long)resource_size(res));
75 (unsigned long long)(res->end - res->start));
76 } 73 }
77 } 74 }
78 out += sprintf(out, "Free resources: bus numbers\n"); 75 out += sprintf(out, "Free resources: bus numbers\n");