MTD/pxa: use resource_size(res) for pxa2xx-flash
PATCH 3/3 MTD/pxa: use resource_size(res) for pxa2xx-flash
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 <[email protected]>
--- drivers/mtd/maps/pxa2xx-flash.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/mtd/maps/pxa2xx-flash.c +1 -1
@@ -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;
Signature · 1 line
1.6.3.3
PATCH 3/3 MTD/pxa: use resource_size(res) for pxa2xx-flash
2010/6/5 Wan ZongShun <[email protected]>:
Quoted 5 lines
The size calculation is end - start + 1. But,sometimes, the '1' can be forgotten carelessly, witch will have potential risk, so use
resource_sizeshould be good habit.Signed-off-by Wan ZongShun <[email protected]>
Acked.
Quoted 21 lines
---
?drivers/mtd/maps/pxa2xx-flash.c | ? ?2 +-
?1 files changed, 1 insertions(+), 1 deletions(-)drivers/mtd/maps/pxa2xx-flash.c +1
-2@@ -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