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/message | |
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/message')
-rw-r--r-- | drivers/message/i2o/iop.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/message/i2o/iop.c b/drivers/message/i2o/iop.c index 090d2a3a6548..a8c08f332da0 100644 --- a/drivers/message/i2o/iop.c +++ b/drivers/message/i2o/iop.c | |||
@@ -681,11 +681,11 @@ static int i2o_iop_systab_set(struct i2o_controller *c) | |||
681 | if (root && allocate_resource(root, res, sb->desired_mem_size, sb->desired_mem_size, sb->desired_mem_size, 1 << 20, /* Unspecified, so use 1Mb and play safe */ | 681 | if (root && allocate_resource(root, res, sb->desired_mem_size, sb->desired_mem_size, sb->desired_mem_size, 1 << 20, /* Unspecified, so use 1Mb and play safe */ |
682 | NULL, NULL) >= 0) { | 682 | NULL, NULL) >= 0) { |
683 | c->mem_alloc = 1; | 683 | c->mem_alloc = 1; |
684 | sb->current_mem_size = 1 + res->end - res->start; | 684 | sb->current_mem_size = resource_size(res); |
685 | sb->current_mem_base = res->start; | 685 | sb->current_mem_base = res->start; |
686 | osm_info("%s: allocated %llu bytes of PCI memory at " | 686 | osm_info("%s: allocated %llu bytes of PCI memory at " |
687 | "0x%016llX.\n", c->name, | 687 | "0x%016llX.\n", c->name, |
688 | (unsigned long long)(1 + res->end - res->start), | 688 | (unsigned long long)resource_size(res), |
689 | (unsigned long long)res->start); | 689 | (unsigned long long)res->start); |
690 | } | 690 | } |
691 | } | 691 | } |
@@ -703,11 +703,11 @@ static int i2o_iop_systab_set(struct i2o_controller *c) | |||
703 | if (root && allocate_resource(root, res, sb->desired_io_size, sb->desired_io_size, sb->desired_io_size, 1 << 20, /* Unspecified, so use 1Mb and play safe */ | 703 | if (root && allocate_resource(root, res, sb->desired_io_size, sb->desired_io_size, sb->desired_io_size, 1 << 20, /* Unspecified, so use 1Mb and play safe */ |
704 | NULL, NULL) >= 0) { | 704 | NULL, NULL) >= 0) { |
705 | c->io_alloc = 1; | 705 | c->io_alloc = 1; |
706 | sb->current_io_size = 1 + res->end - res->start; | 706 | sb->current_io_size = resource_size(res); |
707 | sb->current_mem_base = res->start; | 707 | sb->current_mem_base = res->start; |
708 | osm_info("%s: allocated %llu bytes of PCI I/O at " | 708 | osm_info("%s: allocated %llu bytes of PCI I/O at " |
709 | "0x%016llX.\n", c->name, | 709 | "0x%016llX.\n", c->name, |
710 | (unsigned long long)(1 + res->end - res->start), | 710 | (unsigned long long)resource_size(res), |
711 | (unsigned long long)res->start); | 711 | (unsigned long long)res->start); |
712 | } | 712 | } |
713 | } | 713 | } |