linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3/3] MTD/pxa: use resource_size(res) for pxa2xx-flash
@ 2010-06-05  6:48 Wan ZongShun
  2010-06-05  7:15 ` Eric Miao
  0 siblings, 1 reply; 2+ messages in thread
From: Wan ZongShun @ 2010-06-05  6:48 UTC (permalink / raw)
  To: linux-arm-kernel

The size calculation is end - start + 1. But,sometimes, the '1' can
be forgotten carelessly, witch will have potential risk, so use resource_size
should be good habit.

Signed-off-by :Wan ZongShun <mcuos.com@gmail.com>

---
 drivers/mtd/maps/pxa2xx-flash.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/maps/pxa2xx-flash.c b/drivers/mtd/maps/pxa2xx-flash.c
index 43f8bb8..6ed9a2d 100644
--- a/drivers/mtd/maps/pxa2xx-flash.c
+++ b/drivers/mtd/maps/pxa2xx-flash.c
@@ -79,7 +79,7 @@ static int __devinit pxa2xx_flash_probe(struct platform_device *pdev)
 	info->map.name = (char *) flash->name;
 	info->map.bankwidth = flash->width;
 	info->map.phys = res->start;
-	info->map.size = res->end - res->start + 1;
+	info->map.size = resource_size(res);
 	info->parts = flash->parts;
 	info->nr_parts = flash->nr_parts;

-- 
1.6.3.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH 3/3] MTD/pxa: use resource_size(res) for pxa2xx-flash
  2010-06-05  6:48 [PATCH 3/3] MTD/pxa: use resource_size(res) for pxa2xx-flash Wan ZongShun
@ 2010-06-05  7:15 ` Eric Miao
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Miao @ 2010-06-05  7:15 UTC (permalink / raw)
  To: linux-arm-kernel

2010/6/5 Wan ZongShun <mcuos.com@gmail.com>:
> The size calculation is end - start + 1. But,sometimes, the '1' can
> be forgotten carelessly, witch will have potential risk, so use resource_size
> should be good habit.
>
> Signed-off-by :Wan ZongShun <mcuos.com@gmail.com>

Acked.

>
> ---
> ?drivers/mtd/maps/pxa2xx-flash.c | ? ?2 +-
> ?1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/mtd/maps/pxa2xx-flash.c b/drivers/mtd/maps/pxa2xx-flash.c
> index 43f8bb8..6ed9a2d 100644
> --- a/drivers/mtd/maps/pxa2xx-flash.c
> +++ b/drivers/mtd/maps/pxa2xx-flash.c
> @@ -79,7 +79,7 @@ static int __devinit pxa2xx_flash_probe(struct platform_device *pdev)
> ? ? ? ?info->map.name = (char *) flash->name;
> ? ? ? ?info->map.bankwidth = flash->width;
> ? ? ? ?info->map.phys = res->start;
> - ? ? ? info->map.size = res->end - res->start + 1;
> + ? ? ? info->map.size = resource_size(res);
> ? ? ? ?info->parts = flash->parts;
> ? ? ? ?info->nr_parts = flash->nr_parts;
>
> --
> 1.6.3.3
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-06-05  7:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-05  6:48 [PATCH 3/3] MTD/pxa: use resource_size(res) for pxa2xx-flash Wan ZongShun
2010-06-05  7:15 ` Eric Miao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).