All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: android: Remove unused variable ret for immediate return result.
@ 2016-02-27 12:35 Rakhi Sharma
  2016-03-11 18:35 ` [Outreachy kernel] " Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Rakhi Sharma @ 2016-02-27 12:35 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: Rakhi Sharma

This patch remove unused ret variable and merge two line for immediate
result.
This is done using Coccinelle.Semantic patch used is:

@@
expression ret;
identifier f;
@@

-ret =
+return
     f(...);
-return ret;

Signed-off-by: Rakhi Sharma <rakhish1994@gmail.com>
---
 drivers/staging/android/ion/hisilicon/hi6220_ion.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/android/ion/hisilicon/hi6220_ion.c b/drivers/staging/android/ion/hisilicon/hi6220_ion.c
index e3c07b2..9922710 100644
--- a/drivers/staging/android/ion/hisilicon/hi6220_ion.c
+++ b/drivers/staging/android/ion/hisilicon/hi6220_ion.c
@@ -216,8 +216,7 @@ static int __init hi6220_ion_init(void)
 {
 	int ret;
 
-	ret = platform_driver_register(&hi6220_ion_driver);
-	return ret;
+	return platform_driver_register(&hi6220_ion_driver);
 }
 
 subsys_initcall(hi6220_ion_init);
-- 
1.9.1



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

* Re: [Outreachy kernel] [PATCH] staging: android: Remove unused variable ret for immediate return result.
  2016-02-27 12:35 [PATCH] staging: android: Remove unused variable ret for immediate return result Rakhi Sharma
@ 2016-03-11 18:35 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2016-03-11 18:35 UTC (permalink / raw)
  To: Rakhi Sharma; +Cc: outreachy-kernel

On Sat, Feb 27, 2016 at 06:05:05PM +0530, Rakhi Sharma wrote:
> This patch remove unused ret variable and merge two line for immediate
> result.
> This is done using Coccinelle.Semantic patch used is:
> 
> @@
> expression ret;
> identifier f;
> @@
> 
> -ret =
> +return
>      f(...);
> -return ret;
> 
> Signed-off-by: Rakhi Sharma <rakhish1994@gmail.com>
> ---
>  drivers/staging/android/ion/hisilicon/hi6220_ion.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/android/ion/hisilicon/hi6220_ion.c b/drivers/staging/android/ion/hisilicon/hi6220_ion.c
> index e3c07b2..9922710 100644
> --- a/drivers/staging/android/ion/hisilicon/hi6220_ion.c
> +++ b/drivers/staging/android/ion/hisilicon/hi6220_ion.c
> @@ -216,8 +216,7 @@ static int __init hi6220_ion_init(void)
>  {
>  	int ret;
>  
> -	ret = platform_driver_register(&hi6220_ion_driver);
> -	return ret;
> +	return platform_driver_register(&hi6220_ion_driver);

And now you have a build warning :(

Please always test-build your patches...



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

end of thread, other threads:[~2016-03-11 18:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-27 12:35 [PATCH] staging: android: Remove unused variable ret for immediate return result Rakhi Sharma
2016-03-11 18:35 ` [Outreachy kernel] " Greg KH

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.