2023-04-03 09:42:25

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH] clocksource/drivers/exynos_mct: explicitly return 0 for shared timer

For a shared timers, the mct_init_dt() should not initialize the clock
even with global comparator. This is not an error, thus the function
should simply return 0, not 'ret'.

This also fixes smatch warning:

drivers/clocksource/exynos_mct.c:635 mct_init_dt() warn: missing error code? 'ret'

Reported-by: kernel test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>
Link: https://lore.kernel.org/r/[email protected]/
Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
drivers/clocksource/exynos_mct.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c
index bfd60093ee1c..ef8cb1b71be4 100644
--- a/drivers/clocksource/exynos_mct.c
+++ b/drivers/clocksource/exynos_mct.c
@@ -677,17 +677,17 @@ static int __init mct_init_dt(struct device_node *np, unsigned int int_type)
if (ret)
return ret;

/*
* When the FRC is shared with a main processor, this secondary
* processor cannot use the global comparator.
*/
if (frc_shared)
- return ret;
+ return 0;

return exynos4_clockevent_init();
}


static int __init mct_init_spi(struct device_node *np)
{
return mct_init_dt(np, MCT_INT_SPI);
--
2.34.1


2023-04-03 13:03:30

by Vincent Whitchurch

[permalink] [raw]
Subject: Re: [PATCH] clocksource/drivers/exynos_mct: explicitly return 0 for shared timer

On Mon, 2023-04-03 at 11:40 +0200, Krzysztof Kozlowski wrote:
> For a shared timers, the mct_init_dt() should not initialize the clock
> even with global comparator. This is not an error, thus the function
> should simply return 0, not 'ret'.
>
> This also fixes smatch warning:
>
>   drivers/clocksource/exynos_mct.c:635 mct_init_dt() warn: missing error code? 'ret'
>
> Reported-by: kernel test robot <[email protected]>
> Reported-by: Dan Carpenter <[email protected]>
> Link: https://lore.kernel.org/r/[email protected]/
> Signed-off-by: Krzysztof Kozlowski <[email protected]>

Reviewed-by: Vincent Whitchurch <[email protected]>

2023-04-03 17:05:44

by Alim Akhtar

[permalink] [raw]
Subject: RE: [PATCH] clocksource/drivers/exynos_mct: explicitly return 0 for shared timer

Hello Krzysztof

> -----Original Message-----
> From: Krzysztof Kozlowski <[email protected]>
> Sent: Monday, April 3, 2023 3:10 PM
> To: Daniel Lezcano <[email protected]>; Thomas Gleixner
> <[email protected]>; Krzysztof Kozlowski
<[email protected]>;
> Alim Akhtar <[email protected]>; [email protected];
> [email protected]; [email protected]
> Cc: Vincent Whitchurch <[email protected]>; kernel test robot
> <[email protected]>; Dan Carpenter <[email protected]>
> Subject: [PATCH] clocksource/drivers/exynos_mct: explicitly return 0 for
> shared timer
>
> For a shared timers, the mct_init_dt() should not initialize the clock
even with
> global comparator. This is not an error, thus the function should simply
> return 0, not 'ret'.
>
> This also fixes smatch warning:
>
> drivers/clocksource/exynos_mct.c:635 mct_init_dt() warn: missing error
> code? 'ret'
>
> Reported-by: kernel test robot <[email protected]>
> Reported-by: Dan Carpenter <[email protected]>
> Link: https://lore.kernel.org/r/[email protected]/
> Signed-off-by: Krzysztof Kozlowski <[email protected]>
> ---

Reviewed-by: Alim Akhtar <[email protected]>

> drivers/clocksource/exynos_mct.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/clocksource/exynos_mct.c
> b/drivers/clocksource/exynos_mct.c
> index bfd60093ee1c..ef8cb1b71be4 100644
> --- a/drivers/clocksource/exynos_mct.c
> +++ b/drivers/clocksource/exynos_mct.c
> @@ -677,17 +677,17 @@ static int __init mct_init_dt(struct device_node
> *np, unsigned int int_type)
> if (ret)
> return ret;
>
> /*
> * When the FRC is shared with a main processor, this secondary
> * processor cannot use the global comparator.
> */
> if (frc_shared)
> - return ret;
> + return 0;
>
> return exynos4_clockevent_init();
> }
>
>
> static int __init mct_init_spi(struct device_node *np) {
> return mct_init_dt(np, MCT_INT_SPI);
> --
> 2.34.1


2023-04-06 13:39:25

by Daniel Lezcano

[permalink] [raw]
Subject: Re: [PATCH] clocksource/drivers/exynos_mct: explicitly return 0 for shared timer

On 03/04/2023 11:40, Krzysztof Kozlowski wrote:
> For a shared timers, the mct_init_dt() should not initialize the clock
> even with global comparator. This is not an error, thus the function
> should simply return 0, not 'ret'.
>
> This also fixes smatch warning:
>
> drivers/clocksource/exynos_mct.c:635 mct_init_dt() warn: missing error code? 'ret'
>
> Reported-by: kernel test robot <[email protected]>
> Reported-by: Dan Carpenter <[email protected]>
> Link: https://lore.kernel.org/r/[email protected]/
> Signed-off-by: Krzysztof Kozlowski <[email protected]>
> ---

Applied, thanks

--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

2023-04-26 09:18:10

by tip-bot2 for Tony Luck

[permalink] [raw]
Subject: [tip: timers/core] clocksource/drivers/exynos_mct: Explicitly return 0 for shared timer

The following commit has been merged into the timers/core branch of tip:

Commit-ID: fd3f088f35f610a7ee3045b7d172b362342e43c6
Gitweb: https://git.kernel.org/tip/fd3f088f35f610a7ee3045b7d172b362342e43c6
Author: Krzysztof Kozlowski <[email protected]>
AuthorDate: Mon, 03 Apr 2023 11:40:17 +02:00
Committer: Daniel Lezcano <[email protected]>
CommitterDate: Mon, 24 Apr 2023 16:56:13 +02:00

clocksource/drivers/exynos_mct: Explicitly return 0 for shared timer

For a shared timers, the mct_init_dt() should not initialize the clock
even with global comparator. This is not an error, thus the function
should simply return 0, not 'ret'.

This also fixes smatch warning:

drivers/clocksource/exynos_mct.c:635 mct_init_dt() warn: missing error code? 'ret'

Reported-by: kernel test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>
Link: https://lore.kernel.org/r/[email protected]/
Signed-off-by: Krzysztof Kozlowski <[email protected]>
Reviewed-by: Vincent Whitchurch <[email protected]>
Reviewed-by: Alim Akhtar <[email protected]>
Signed-off-by: Daniel Lezcano <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
---
drivers/clocksource/exynos_mct.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c
index bfd6009..ef8cb1b 100644
--- a/drivers/clocksource/exynos_mct.c
+++ b/drivers/clocksource/exynos_mct.c
@@ -682,7 +682,7 @@ static int __init mct_init_dt(struct device_node *np, unsigned int int_type)
* processor cannot use the global comparator.
*/
if (frc_shared)
- return ret;
+ return 0;

return exynos4_clockevent_init();
}