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/pnp/pnpacpi | |
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/pnp/pnpacpi')
-rw-r--r-- | drivers/pnp/pnpacpi/rsparser.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/pnp/pnpacpi/rsparser.c b/drivers/pnp/pnpacpi/rsparser.c index 100e4d9372f1..1a6937d9118f 100644 --- a/drivers/pnp/pnpacpi/rsparser.c +++ b/drivers/pnp/pnpacpi/rsparser.c | |||
@@ -1018,7 +1018,7 @@ static void pnpacpi_encode_io(struct pnp_dev *dev, | |||
1018 | io->minimum = p->start; | 1018 | io->minimum = p->start; |
1019 | io->maximum = p->end; | 1019 | io->maximum = p->end; |
1020 | io->alignment = 0; /* Correct? */ | 1020 | io->alignment = 0; /* Correct? */ |
1021 | io->address_length = p->end - p->start + 1; | 1021 | io->address_length = resource_size(p); |
1022 | } else { | 1022 | } else { |
1023 | io->minimum = 0; | 1023 | io->minimum = 0; |
1024 | io->address_length = 0; | 1024 | io->address_length = 0; |
@@ -1036,7 +1036,7 @@ static void pnpacpi_encode_fixed_io(struct pnp_dev *dev, | |||
1036 | 1036 | ||
1037 | if (pnp_resource_enabled(p)) { | 1037 | if (pnp_resource_enabled(p)) { |
1038 | fixed_io->address = p->start; | 1038 | fixed_io->address = p->start; |
1039 | fixed_io->address_length = p->end - p->start + 1; | 1039 | fixed_io->address_length = resource_size(p); |
1040 | } else { | 1040 | } else { |
1041 | fixed_io->address = 0; | 1041 | fixed_io->address = 0; |
1042 | fixed_io->address_length = 0; | 1042 | fixed_io->address_length = 0; |
@@ -1059,7 +1059,7 @@ static void pnpacpi_encode_mem24(struct pnp_dev *dev, | |||
1059 | memory24->minimum = p->start; | 1059 | memory24->minimum = p->start; |
1060 | memory24->maximum = p->end; | 1060 | memory24->maximum = p->end; |
1061 | memory24->alignment = 0; | 1061 | memory24->alignment = 0; |
1062 | memory24->address_length = p->end - p->start + 1; | 1062 | memory24->address_length = resource_size(p); |
1063 | } else { | 1063 | } else { |
1064 | memory24->minimum = 0; | 1064 | memory24->minimum = 0; |
1065 | memory24->address_length = 0; | 1065 | memory24->address_length = 0; |
@@ -1083,7 +1083,7 @@ static void pnpacpi_encode_mem32(struct pnp_dev *dev, | |||
1083 | memory32->minimum = p->start; | 1083 | memory32->minimum = p->start; |
1084 | memory32->maximum = p->end; | 1084 | memory32->maximum = p->end; |
1085 | memory32->alignment = 0; | 1085 | memory32->alignment = 0; |
1086 | memory32->address_length = p->end - p->start + 1; | 1086 | memory32->address_length = resource_size(p); |
1087 | } else { | 1087 | } else { |
1088 | memory32->minimum = 0; | 1088 | memory32->minimum = 0; |
1089 | memory32->alignment = 0; | 1089 | memory32->alignment = 0; |
@@ -1106,7 +1106,7 @@ static void pnpacpi_encode_fixed_mem32(struct pnp_dev *dev, | |||
1106 | p->flags & IORESOURCE_MEM_WRITEABLE ? | 1106 | p->flags & IORESOURCE_MEM_WRITEABLE ? |
1107 | ACPI_READ_WRITE_MEMORY : ACPI_READ_ONLY_MEMORY; | 1107 | ACPI_READ_WRITE_MEMORY : ACPI_READ_ONLY_MEMORY; |
1108 | fixed_memory32->address = p->start; | 1108 | fixed_memory32->address = p->start; |
1109 | fixed_memory32->address_length = p->end - p->start + 1; | 1109 | fixed_memory32->address_length = resource_size(p); |
1110 | } else { | 1110 | } else { |
1111 | fixed_memory32->address = 0; | 1111 | fixed_memory32->address = 0; |
1112 | fixed_memory32->address_length = 0; | 1112 | fixed_memory32->address_length = 0; |