aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel
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 /arch/sh/kernel
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 'arch/sh/kernel')
-rw-r--r--arch/sh/kernel/io_trapped.c8
-rw-r--r--arch/sh/kernel/machine_kexec.c2
2 files changed, 5 insertions, 5 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;
diff --git a/arch/sh/kernel/machine_kexec.c b/arch/sh/kernel/machine_kexec.c
index e2a3af31ff99..c5a33f007f88 100644
--- a/arch/sh/kernel/machine_kexec.c
+++ b/arch/sh/kernel/machine_kexec.c
@@ -170,7 +170,7 @@ void __init reserve_crashkernel(void)
170 if (crashk_res.end == crashk_res.start) 170 if (crashk_res.end == crashk_res.start)
171 goto disable; 171 goto disable;
172 172
173 crash_size = PAGE_ALIGN(crashk_res.end - crashk_res.start + 1); 173 crash_size = PAGE_ALIGN(resource_size(&crashk_res));
174 if (!crashk_res.start) { 174 if (!crashk_res.start) {
175 unsigned long max = memblock_end_of_DRAM() - memory_limit; 175 unsigned long max = memblock_end_of_DRAM() - memory_limit;
176 crashk_res.start = __memblock_alloc_base(crash_size, PAGE_SIZE, max); 176 crashk_res.start = __memblock_alloc_base(crash_size, PAGE_SIZE, max);