diff mbox series

i3c: master: svc: fix returnvar.cocci warning

Message ID 20220504164901.9622-1-guozhengkui@vivo.com (mailing list archive)
State Accepted
Headers show
Series i3c: master: svc: fix returnvar.cocci warning | expand

Commit Message

Guo Zhengkui May 4, 2022, 4:49 p.m. UTC
Fix the following coccicheck warning:

drivers/i3c/master/svc-i3c-master.c:1600:5-8:
Unneeded variable: "ret". Return "0" on line 1605.

Signed-off-by: Guo Zhengkui <guozhengkui@vivo.com>
---
 drivers/i3c/master/svc-i3c-master.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Miquel Raynal May 9, 2022, 1:22 p.m. UTC | #1
Hi,

guozhengkui@vivo.com wrote on Thu,  5 May 2022 00:49:01 +0800:

> Fix the following coccicheck warning:
> 
> drivers/i3c/master/svc-i3c-master.c:1600:5-8:
> Unneeded variable: "ret". Return "0" on line 1605.
> 
> Signed-off-by: Guo Zhengkui <guozhengkui@vivo.com>
> ---
>  drivers/i3c/master/svc-i3c-master.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c
> index 7550dad64ecf..d6e9ed74cdcf 100644
> --- a/drivers/i3c/master/svc-i3c-master.c
> +++ b/drivers/i3c/master/svc-i3c-master.c
> @@ -1597,12 +1597,11 @@ static int __maybe_unused svc_i3c_runtime_suspend(struct device *dev)
>  static int __maybe_unused svc_i3c_runtime_resume(struct device *dev)
>  {
>  	struct svc_i3c_master *master = dev_get_drvdata(dev);
> -	int ret = 0;
>  
>  	pinctrl_pm_select_default_state(dev);
>  	svc_i3c_master_prepare_clks(master);
>  
> -	return ret;
> +	return 0;
>  }
>  
>  static const struct dev_pm_ops svc_i3c_pm_ops = {

Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>

Thanks,
Miquèl
Alexandre Belloni May 17, 2022, 8:36 p.m. UTC | #2
From: Alexandre Belloni <alexandre.belloni@bootlin.com>

On Thu, 5 May 2022 00:49:01 +0800, Guo Zhengkui wrote:
> Fix the following coccicheck warning:
> 
> drivers/i3c/master/svc-i3c-master.c:1600:5-8:
> Unneeded variable: "ret". Return "0" on line 1605.
> 
> 

Applied, thanks!

[1/1] i3c: master: svc: fix returnvar.cocci warning
      commit: 227fab1ee7ca70c9b4b0915898e81327aeb70414

Best regards,
diff mbox series

Patch

diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c
index 7550dad64ecf..d6e9ed74cdcf 100644
--- a/drivers/i3c/master/svc-i3c-master.c
+++ b/drivers/i3c/master/svc-i3c-master.c
@@ -1597,12 +1597,11 @@  static int __maybe_unused svc_i3c_runtime_suspend(struct device *dev)
 static int __maybe_unused svc_i3c_runtime_resume(struct device *dev)
 {
 	struct svc_i3c_master *master = dev_get_drvdata(dev);
-	int ret = 0;
 
 	pinctrl_pm_select_default_state(dev);
 	svc_i3c_master_prepare_clks(master);
 
-	return ret;
+	return 0;
 }
 
 static const struct dev_pm_ops svc_i3c_pm_ops = {