2013-03-17 09:11:05

by Alexandru Gheorghiu

[permalink] [raw]
Subject: [PATCH] drivers: ata: Use resource_size function

Use resource_size function instead of explicit computation.
Patch found using coccinelle.

Signed-off-by: Alexandru Gheorghiu <[email protected]>
---
drivers/ata/pata_octeon_cf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ata/pata_octeon_cf.c b/drivers/ata/pata_octeon_cf.c
index ff2e57f..e73bef3 100644
--- a/drivers/ata/pata_octeon_cf.c
+++ b/drivers/ata/pata_octeon_cf.c
@@ -926,7 +926,7 @@ static int octeon_cf_probe(struct platform_device *pdev)
goto free_cf_port;
}
cs1 = devm_ioremap_nocache(&pdev->dev, res_cs1->start,
- res_cs1->end - res_cs1->start + 1);
+ resource_size(res_cs1));

if (!cs1)
goto free_cf_port;
--
1.7.9.5


2013-04-03 23:56:18

by Jeff Garzik

[permalink] [raw]
Subject: Re: [PATCH] drivers: ata: Use resource_size function

On 03/16/2013 10:32 AM, Alexandru Gheorghiu wrote:
> Use resource_size function instead of explicit computation.
> Patch found using coccinelle.
>
> Signed-off-by: Alexandru Gheorghiu <[email protected]>
> ---
> drivers/ata/pata_octeon_cf.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

applied