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>
这个提交包含在:
@@ -841,7 +841,7 @@ static int __devinit octeon_cf_probe(struct platform_device *pdev)
|
||||
ocd = pdev->dev.platform_data;
|
||||
|
||||
cs0 = devm_ioremap_nocache(&pdev->dev, res_cs0->start,
|
||||
res_cs0->end - res_cs0->start + 1);
|
||||
resource_size(res_cs0));
|
||||
|
||||
if (!cs0)
|
||||
return -ENOMEM;
|
||||
|
在新工单中引用
屏蔽一个用户