Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1375493
| From | Vaishali Thakkar <vaishali.thakkar@oracle.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH] clk: sunxi: Use resource_size |
| Date | 2016-04-11 07:00 +0200 |
| Message-ID | <rmC78-6h-5@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
Use the function resource_size instaed of explicit computation. Problem found using Coccinelle. Signed-off-by: Vaishali Thakkar <vaishali.thakkar@oracle.com> --- 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
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH] clk: sunxi: Use resource_size Vaishali Thakkar <vaishali.thakkar@oracle.com> - 2016-04-11 07:00 +0200 Re: [PATCH] clk: sunxi: Use resource_size Chen-Yu Tsai <wens@csie.org> - 2016-04-11 16:40 +0200 Re: [PATCH] clk: sunxi: Use resource_size Maxime Ripard <maxime.ripard@free-electrons.com> - 2016-04-14 18:00 +0200
csiph-web