linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] spi/atmel: fix simple_return.cocci warnings
@ 2014-10-16 16:18 Fengguang Wu
       [not found] ` <543feff0.QhS1UtLsJt/o5948%fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Fengguang Wu @ 2014-10-16 16:18 UTC (permalink / raw)
  To: Mark Brown
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-spi-u79uwXL29TY76Z2rM5mHXA, Wenyou Yang

drivers/spi/spi-atmel.c:1518:1-4: WARNING: end returns can be simpified and declaration on line 1514 can be dropped

 Simplify a trivial if-return sequence.  Possibly combine with a
 preceding function call.
Generated by: scripts/coccinelle/misc/simple_return.cocci

CC: Wenyou Yang <wenyou.yang-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Fengguang Wu <fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---

Please take the patch only if it's a positive warning. Thanks!

 spi-atmel.c |    7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

--- a/drivers/spi/spi-atmel.c
+++ b/drivers/spi/spi-atmel.c
@@ -1511,15 +1511,10 @@ static int atmel_spi_runtime_resume(stru
 {
 	struct spi_master *master = dev_get_drvdata(dev);
 	struct atmel_spi *as = spi_master_get_devdata(master);
-	int ret;
 
 	pinctrl_pm_select_default_state(dev);
 
-	ret = clk_prepare_enable(as->clk);
-	if (ret)
-		return ret;
-
-	return 0;
+	return clk_prepare_enable(as->clk);
 }
 #endif
 
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] spi/atmel: fix simple_return.cocci warnings
       [not found] ` <543feff0.QhS1UtLsJt/o5948%fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
@ 2014-10-17  8:58   ` Mark Brown
  2014-10-17  9:05   ` Nicolas Ferre
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2014-10-17  8:58 UTC (permalink / raw)
  To: Fengguang Wu
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-spi-u79uwXL29TY76Z2rM5mHXA, Wenyou Yang

[-- Attachment #1: Type: text/plain, Size: 198 bytes --]

On Fri, Oct 17, 2014 at 12:18:56AM +0800, Fengguang Wu wrote:
> drivers/spi/spi-atmel.c:1518:1-4: WARNING: end returns can be simpified and declaration on line 1514 can be dropped

Applied, thanks.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] spi/atmel: fix simple_return.cocci warnings
       [not found] ` <543feff0.QhS1UtLsJt/o5948%fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
  2014-10-17  8:58   ` Mark Brown
@ 2014-10-17  9:05   ` Nicolas Ferre
  1 sibling, 0 replies; 3+ messages in thread
From: Nicolas Ferre @ 2014-10-17  9:05 UTC (permalink / raw)
  To: Fengguang Wu, Mark Brown
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-spi-u79uwXL29TY76Z2rM5mHXA, Wenyou Yang

On 16/10/2014 18:18, Fengguang Wu :
> drivers/spi/spi-atmel.c:1518:1-4: WARNING: end returns can be simpified and declaration on line 1514 can be dropped
> 
>  Simplify a trivial if-return sequence.  Possibly combine with a
>  preceding function call.
> Generated by: scripts/coccinelle/misc/simple_return.cocci
> 
> CC: Wenyou Yang <wenyou.yang-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
> Signed-off-by: Fengguang Wu <fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> ---
> 
> Please take the patch only if it's a positive warning. Thanks!
> 
>  spi-atmel.c |    7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> --- a/drivers/spi/spi-atmel.c
> +++ b/drivers/spi/spi-atmel.c
> @@ -1511,15 +1511,10 @@ static int atmel_spi_runtime_resume(stru
>  {
>  	struct spi_master *master = dev_get_drvdata(dev);
>  	struct atmel_spi *as = spi_master_get_devdata(master);
> -	int ret;
>  
>  	pinctrl_pm_select_default_state(dev);
>  
> -	ret = clk_prepare_enable(as->clk);
> -	if (ret)
> -		return ret;
> -
> -	return 0;
> +	return clk_prepare_enable(as->clk);

Indeed:

Acked-by: Nicolas Ferre <nicolas.ferre-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>

>  }
>  #endif
>  
> --
> To unsubscribe from this list: send the line "unsubscribe devicetree" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


-- 
Nicolas Ferre
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-10-17  9:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-16 16:18 [PATCH] spi/atmel: fix simple_return.cocci warnings Fengguang Wu
     [not found] ` <543feff0.QhS1UtLsJt/o5948%fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-10-17  8:58   ` Mark Brown
2014-10-17  9:05   ` Nicolas Ferre

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).