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

Message ID 20230403094017.9556-1-krzysztof.kozlowski@linaro.org
State New
Headers
Series clocksource/drivers/exynos_mct: explicitly return 0 for shared timer |

Commit Message

Krzysztof Kozlowski April 3, 2023, 9:40 a.m. UTC
  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 <lkp@intel.com>
Reported-by: Dan Carpenter <error27@gmail.com>
Link: https://lore.kernel.org/r/202304021446.46XVKag0-lkp@intel.com/
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/clocksource/exynos_mct.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Vincent Whitchurch April 3, 2023, 12:59 p.m. UTC | #1
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 <lkp@intel.com>
> Reported-by: Dan Carpenter <error27@gmail.com>
> Link: https://lore.kernel.org/r/202304021446.46XVKag0-lkp@intel.com/
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Reviewed-by: Vincent Whitchurch <vincent.whitchurch@axis.com>
  
Alim Akhtar April 3, 2023, 4:49 p.m. UTC | #2
Hello Krzysztof

> -----Original Message-----
> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Sent: Monday, April 3, 2023 3:10 PM
> To: Daniel Lezcano <daniel.lezcano@linaro.org>; Thomas Gleixner
> <tglx@linutronix.de>; Krzysztof Kozlowski
<krzysztof.kozlowski@linaro.org>;
> Alim Akhtar <alim.akhtar@samsung.com>; linux-kernel@vger.kernel.org;
> linux-arm-kernel@lists.infradead.org; linux-samsung-soc@vger.kernel.org
> Cc: Vincent Whitchurch <vincent.whitchurch@axis.com>; kernel test robot
> <lkp@intel.com>; Dan Carpenter <error27@gmail.com>
> 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 <lkp@intel.com>
> Reported-by: Dan Carpenter <error27@gmail.com>
> Link: https://lore.kernel.org/r/202304021446.46XVKag0-lkp@intel.com/
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---

Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com>

>  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
  
Daniel Lezcano April 6, 2023, 1:37 p.m. UTC | #3
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 <lkp@intel.com>
> Reported-by: Dan Carpenter <error27@gmail.com>
> Link: https://lore.kernel.org/r/202304021446.46XVKag0-lkp@intel.com/
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---

Applied, thanks
  

Patch

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);