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/pnpbios | |
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/pnpbios')
-rw-r--r-- | drivers/pnp/pnpbios/rsparser.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/pnp/pnpbios/rsparser.c b/drivers/pnp/pnpbios/rsparser.c index cb1f47bfee96..cca2f9f9f3e3 100644 --- a/drivers/pnp/pnpbios/rsparser.c +++ b/drivers/pnp/pnpbios/rsparser.c | |||
@@ -505,7 +505,7 @@ static void pnpbios_encode_mem(struct pnp_dev *dev, unsigned char *p, | |||
505 | 505 | ||
506 | if (pnp_resource_enabled(res)) { | 506 | if (pnp_resource_enabled(res)) { |
507 | base = res->start; | 507 | base = res->start; |
508 | len = res->end - res->start + 1; | 508 | len = resource_size(res); |
509 | } else { | 509 | } else { |
510 | base = 0; | 510 | base = 0; |
511 | len = 0; | 511 | len = 0; |
@@ -529,7 +529,7 @@ static void pnpbios_encode_mem32(struct pnp_dev *dev, unsigned char *p, | |||
529 | 529 | ||
530 | if (pnp_resource_enabled(res)) { | 530 | if (pnp_resource_enabled(res)) { |
531 | base = res->start; | 531 | base = res->start; |
532 | len = res->end - res->start + 1; | 532 | len = resource_size(res); |
533 | } else { | 533 | } else { |
534 | base = 0; | 534 | base = 0; |
535 | len = 0; | 535 | len = 0; |
@@ -559,7 +559,7 @@ static void pnpbios_encode_fixed_mem32(struct pnp_dev *dev, unsigned char *p, | |||
559 | 559 | ||
560 | if (pnp_resource_enabled(res)) { | 560 | if (pnp_resource_enabled(res)) { |
561 | base = res->start; | 561 | base = res->start; |
562 | len = res->end - res->start + 1; | 562 | len = resource_size(res); |
563 | } else { | 563 | } else { |
564 | base = 0; | 564 | base = 0; |
565 | len = 0; | 565 | len = 0; |
@@ -617,7 +617,7 @@ static void pnpbios_encode_port(struct pnp_dev *dev, unsigned char *p, | |||
617 | 617 | ||
618 | if (pnp_resource_enabled(res)) { | 618 | if (pnp_resource_enabled(res)) { |
619 | base = res->start; | 619 | base = res->start; |
620 | len = res->end - res->start + 1; | 620 | len = resource_size(res); |
621 | } else { | 621 | } else { |
622 | base = 0; | 622 | base = 0; |
623 | len = 0; | 623 | len = 0; |
@@ -636,11 +636,11 @@ static void pnpbios_encode_fixed_port(struct pnp_dev *dev, unsigned char *p, | |||
636 | struct resource *res) | 636 | struct resource *res) |
637 | { | 637 | { |
638 | unsigned long base = res->start; | 638 | unsigned long base = res->start; |
639 | unsigned long len = res->end - res->start + 1; | 639 | unsigned long len = resource_size(res); |
640 | 640 | ||
641 | if (pnp_resource_enabled(res)) { | 641 | if (pnp_resource_enabled(res)) { |
642 | base = res->start; | 642 | base = res->start; |
643 | len = res->end - res->start + 1; | 643 | len = resource_size(res); |
644 | } else { | 644 | } else { |
645 | base = 0; | 645 | base = 0; |
646 | len = 0; | 646 | len = 0; |