Use the function resource_size instaed of explicit computation.
Problem found using Coccinelle.
Signed-off-by: Vaishali Thakkar <[email protected]>
---
drivers/clk/sunxi/clk-sun9i-mmc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/clk/sunxi/clk-sun9i-mmc.c b/drivers/clk/sunxi/clk-sun9i-mmc.c
index 028dd83..7167373 100644
--- a/drivers/clk/sunxi/clk-sun9i-mmc.c
+++ b/drivers/clk/sunxi/clk-sun9i-mmc.c
@@ -106,7 +106,7 @@ static int sun9i_a80_mmc_config_clk_probe(struct platform_device *pdev)
r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
/* one clock/reset pair per word */
- count = DIV_ROUND_UP((r->end - r->start + 1), SUN9I_MMC_WIDTH);
+ count = DIV_ROUND_UP((resource_size(r)), SUN9I_MMC_WIDTH);
data->membase = devm_ioremap_resource(&pdev->dev, r);
if (IS_ERR(data->membase))
return PTR_ERR(data->membase);
--
2.1.4
On Mon, Apr 11, 2016 at 12:53 PM, Vaishali Thakkar
<[email protected]> wrote:
> Use the function resource_size instaed of explicit computation.
>
> Problem found using Coccinelle.
>
> Signed-off-by: Vaishali Thakkar <[email protected]>
Acked-by: Chen-Yu Tsai <[email protected]>
On Mon, Apr 11, 2016 at 10:23:03AM +0530, Vaishali Thakkar wrote:
> Use the function resource_size instaed of explicit computation.
>
> Problem found using Coccinelle.
>
> Signed-off-by: Vaishali Thakkar <[email protected]>
Applied, thanks !
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com