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:
@@ -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;
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user