drivers/ata: use resource_size

Use the function resource_size, which reduces the chance of introducing
off-by-one errors in calculating the resource size.

The semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@@
struct resource *res;
@@

- (res->end - res->start) + 1
+ resource_size(res)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
This commit is contained in:
Julia Lawall
2009-08-06 16:05:08 -07:00
committed by Jeff Garzik
부모 f90f613c3e
커밋 041b5eac25
4개의 변경된 파일7개의 추가작업 그리고 7개의 파일을 삭제

파일 보기

@@ -4013,7 +4013,7 @@ static int mv_platform_probe(struct platform_device *pdev)
host->iomap = NULL;
hpriv->base = devm_ioremap(&pdev->dev, res->start,
res->end - res->start + 1);
resource_size(res));
hpriv->base -= SATAHC0_REG_BASE;
/*