Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: sunxi: Use resource_size

Use the function resource_size instaed of explicit computation.

Problem found using Coccinelle.

Signed-off-by: Vaishali Thakkar <vaishali.thakkar@oracle.com>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>

authored by

Vaishali Thakkar and committed by
Maxime Ripard
f4b9ef65 5ed400dd

+1 -1
+1 -1
drivers/clk/sunxi/clk-sun9i-mmc.c
··· 106 106 107 107 r = platform_get_resource(pdev, IORESOURCE_MEM, 0); 108 108 /* one clock/reset pair per word */ 109 - count = DIV_ROUND_UP((r->end - r->start + 1), SUN9I_MMC_WIDTH); 109 + count = DIV_ROUND_UP((resource_size(r)), SUN9I_MMC_WIDTH); 110 110 data->membase = devm_ioremap_resource(&pdev->dev, r); 111 111 if (IS_ERR(data->membase)) 112 112 return PTR_ERR(data->membase);