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 /drivers/char | |
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 'drivers/char')
-rw-r--r-- | drivers/char/bsr.c | 2 | ||||
-rw-r--r-- | drivers/char/xilinx_hwicap/xilinx_hwicap.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/char/bsr.c b/drivers/char/bsr.c index cf39bc08ce08..0c688232aab3 100644 --- a/drivers/char/bsr.c +++ b/drivers/char/bsr.c | |||
@@ -212,7 +212,7 @@ static int bsr_add_node(struct device_node *bn) | |||
212 | 212 | ||
213 | cur->bsr_minor = i + total_bsr_devs; | 213 | cur->bsr_minor = i + total_bsr_devs; |
214 | cur->bsr_addr = res.start; | 214 | cur->bsr_addr = res.start; |
215 | cur->bsr_len = res.end - res.start + 1; | 215 | cur->bsr_len = resource_size(&res); |
216 | cur->bsr_bytes = bsr_bytes[i]; | 216 | cur->bsr_bytes = bsr_bytes[i]; |
217 | cur->bsr_stride = bsr_stride[i]; | 217 | cur->bsr_stride = bsr_stride[i]; |
218 | cur->bsr_dev = MKDEV(bsr_major, i + total_bsr_devs); | 218 | cur->bsr_dev = MKDEV(bsr_major, i + total_bsr_devs); |
diff --git a/drivers/char/xilinx_hwicap/xilinx_hwicap.c b/drivers/char/xilinx_hwicap/xilinx_hwicap.c index 39ccdeada791..e90e1c74fd4c 100644 --- a/drivers/char/xilinx_hwicap/xilinx_hwicap.c +++ b/drivers/char/xilinx_hwicap/xilinx_hwicap.c | |||
@@ -621,7 +621,7 @@ static int __devinit hwicap_setup(struct device *dev, int id, | |||
621 | 621 | ||
622 | drvdata->mem_start = regs_res->start; | 622 | drvdata->mem_start = regs_res->start; |
623 | drvdata->mem_end = regs_res->end; | 623 | drvdata->mem_end = regs_res->end; |
624 | drvdata->mem_size = regs_res->end - regs_res->start + 1; | 624 | drvdata->mem_size = resource_size(regs_res); |
625 | 625 | ||
626 | if (!request_mem_region(drvdata->mem_start, | 626 | if (!request_mem_region(drvdata->mem_start, |
627 | drvdata->mem_size, DRIVER_NAME)) { | 627 | drvdata->mem_size, DRIVER_NAME)) { |