diff options
author | Joe Perches <joe@perches.com> | 2011-06-09 12:13:32 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2011-06-10 08:55:36 -0400 |
commit | 28f65c11f2ffb3957259dece647a24f8ad2e241b (patch) | |
tree | 6b7621d09d10df89eedd908d4506fb9f457a909f /arch/sh/kernel/io_trapped.c | |
parent | 140a1ef2f91a00e1d25f0878c193abdc25bf6ebe (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 'arch/sh/kernel/io_trapped.c')
-rw-r--r-- | arch/sh/kernel/io_trapped.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/sh/kernel/io_trapped.c b/arch/sh/kernel/io_trapped.c index 32c385ef1011..0f62f4672754 100644 --- a/arch/sh/kernel/io_trapped.c +++ b/arch/sh/kernel/io_trapped.c | |||
@@ -58,7 +58,7 @@ int register_trapped_io(struct trapped_io *tiop) | |||
58 | 58 | ||
59 | for (k = 0; k < tiop->num_resources; k++) { | 59 | for (k = 0; k < tiop->num_resources; k++) { |
60 | res = tiop->resource + k; | 60 | res = tiop->resource + k; |
61 | len += roundup((res->end - res->start) + 1, PAGE_SIZE); | 61 | len += roundup(resource_size(res), PAGE_SIZE); |
62 | flags |= res->flags; | 62 | flags |= res->flags; |
63 | } | 63 | } |
64 | 64 | ||
@@ -85,7 +85,7 @@ int register_trapped_io(struct trapped_io *tiop) | |||
85 | (unsigned long)(tiop->virt_base + len), | 85 | (unsigned long)(tiop->virt_base + len), |
86 | res->flags & IORESOURCE_IO ? "io" : "mmio", | 86 | res->flags & IORESOURCE_IO ? "io" : "mmio", |
87 | (unsigned long)res->start); | 87 | (unsigned long)res->start); |
88 | len += roundup((res->end - res->start) + 1, PAGE_SIZE); | 88 | len += roundup(resource_size(res), PAGE_SIZE); |
89 | } | 89 | } |
90 | 90 | ||
91 | tiop->magic = IO_TRAPPED_MAGIC; | 91 | tiop->magic = IO_TRAPPED_MAGIC; |
@@ -128,7 +128,7 @@ void __iomem *match_trapped_io_handler(struct list_head *list, | |||
128 | return tiop->virt_base + voffs; | 128 | return tiop->virt_base + voffs; |
129 | } | 129 | } |
130 | 130 | ||
131 | len = (res->end - res->start) + 1; | 131 | len = resource_size(res); |
132 | voffs += roundup(len, PAGE_SIZE); | 132 | voffs += roundup(len, PAGE_SIZE); |
133 | } | 133 | } |
134 | } | 134 | } |
@@ -173,7 +173,7 @@ static unsigned long lookup_address(struct trapped_io *tiop, | |||
173 | 173 | ||
174 | for (k = 0; k < tiop->num_resources; k++) { | 174 | for (k = 0; k < tiop->num_resources; k++) { |
175 | res = tiop->resource + k; | 175 | res = tiop->resource + k; |
176 | len = roundup((res->end - res->start) + 1, PAGE_SIZE); | 176 | len = roundup(resource_size(res), PAGE_SIZE); |
177 | if (address < (vaddr + len)) | 177 | if (address < (vaddr + len)) |
178 | return res->start + (address - vaddr); | 178 | return res->start + (address - vaddr); |
179 | vaddr += len; | 179 | vaddr += len; |