* [PATCH] clk: sunxi: Use resource_size
@ 2016-04-11 4:53 ` Vaishali Thakkar
0 siblings, 0 replies; 6+ messages in thread
From: Vaishali Thakkar @ 2016-04-11 4:53 UTC (permalink / raw)
To: emilio
Cc: mturquette, sboyd, maxime.ripard, linux-clk, linux-arm-kernel,
linux-kernel, Vaishali Thakkar
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
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] clk: sunxi: Use resource_size
@ 2016-04-11 4:53 ` Vaishali Thakkar
0 siblings, 0 replies; 6+ messages in thread
From: Vaishali Thakkar @ 2016-04-11 4:53 UTC (permalink / raw)
To: linux-arm-kernel
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
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] clk: sunxi: Use resource_size
2016-04-11 4:53 ` Vaishali Thakkar
@ 2016-04-11 14:39 ` Chen-Yu Tsai
-1 siblings, 0 replies; 6+ messages in thread
From: Chen-Yu Tsai @ 2016-04-11 14:39 UTC (permalink / raw)
To: Vaishali Thakkar
Cc: Emilio Lopez, Michael Turquette, Stephen Boyd, linux-kernel,
Maxime Ripard, linux-clk, linux-arm-kernel
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>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] clk: sunxi: Use resource_size
@ 2016-04-11 14:39 ` Chen-Yu Tsai
0 siblings, 0 replies; 6+ messages in thread
From: Chen-Yu Tsai @ 2016-04-11 14:39 UTC (permalink / raw)
To: linux-arm-kernel
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>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] clk: sunxi: Use resource_size
2016-04-11 4:53 ` Vaishali Thakkar
@ 2016-04-14 15:56 ` Maxime Ripard
-1 siblings, 0 replies; 6+ messages in thread
From: Maxime Ripard @ 2016-04-14 15:56 UTC (permalink / raw)
To: Vaishali Thakkar
Cc: emilio, mturquette, sboyd, linux-clk, linux-arm-kernel, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 384 bytes --]
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
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] clk: sunxi: Use resource_size
@ 2016-04-14 15:56 ` Maxime Ripard
0 siblings, 0 replies; 6+ messages in thread
From: Maxime Ripard @ 2016-04-14 15:56 UTC (permalink / raw)
To: linux-arm-kernel
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160414/b9093595/attachment.sig>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-04-14 15:56 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-11 4:53 [PATCH] clk: sunxi: Use resource_size Vaishali Thakkar
2016-04-11 4:53 ` Vaishali Thakkar
2016-04-11 14:39 ` Chen-Yu Tsai
2016-04-11 14:39 ` Chen-Yu Tsai
2016-04-14 15:56 ` Maxime Ripard
2016-04-14 15:56 ` Maxime Ripard
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.