Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1375493 > unrolled thread

[PATCH] clk: sunxi: Use resource_size

Started byVaishali Thakkar <vaishali.thakkar@oracle.com>
First post2016-04-11 07:00 +0200
Last post2016-04-14 18:00 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [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

#1375493 — [PATCH] clk: sunxi: Use resource_size

FromVaishali Thakkar <vaishali.thakkar@oracle.com>
Date2016-04-11 07:00 +0200
Subject[PATCH] clk: sunxi: Use resource_size
Message-ID<rmC78-6h-5@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1376026

FromChen-Yu Tsai <wens@csie.org>
Date2016-04-11 16:40 +0200
Message-ID<rmLap-7r8-5@gated-at.bofh.it>
In reply to#1375493
On Mon, Apr 11, 2016 at 12:53 PM, Vaishali Thakkar
<vaishali.thakkar@oracle.com> wrote:
> 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>

[toc] | [prev] | [next] | [standalone]


#1379056

FromMaxime Ripard <maxime.ripard@free-electrons.com>
Date2016-04-14 18:00 +0200
Message-ID<rnRQu-4b1-15@gated-at.bofh.it>
In reply to#1375493

[Multipart message — attachments visible in raw view] — view raw

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 <vaishali.thakkar@oracle.com>

Applied, thanks !
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web