All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: speakup: Remove return variable
@ 2019-03-19 19:37 Nishka Dasgupta
  2019-03-19 20:01 ` [Outreachy kernel] " Julia Lawall
  2019-03-19 22:05 ` Samuel Thibault
  0 siblings, 2 replies; 4+ messages in thread
From: Nishka Dasgupta @ 2019-03-19 19:37 UTC (permalink / raw)
  To: w.d.hubbs, chris, kirk, samuel.thibault, gregkh, outreachy-kernel
  Cc: Nishka Dasgupta

Remove return variable and return the required value directly. Issue
suggested by Coccinelle using ret.cocci.

Signed-off-by: Nishka Dasgupta <nishka.dasgupta@yahoo.com>
---
 drivers/staging/speakup/i18n.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/speakup/i18n.c b/drivers/staging/speakup/i18n.c
index ee240d36f947..a748eb8052d1 100644
--- a/drivers/staging/speakup/i18n.c
+++ b/drivers/staging/speakup/i18n.c
@@ -470,8 +470,7 @@ static char *find_specifier_end(char *input)
 	input++;		/* Advance over %. */
 	input = skip_flags(input);
 	input = skip_width(input);
-	input = skip_conversion(input);
-	return input;
+	return skip_conversion(input);
 }
 
 /*
-- 
2.19.1



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

* Re: [Outreachy kernel] [PATCH] staging: speakup: Remove return variable
  2019-03-19 19:37 [PATCH] staging: speakup: Remove return variable Nishka Dasgupta
@ 2019-03-19 20:01 ` Julia Lawall
  2019-03-19 22:05 ` Samuel Thibault
  1 sibling, 0 replies; 4+ messages in thread
From: Julia Lawall @ 2019-03-19 20:01 UTC (permalink / raw)
  To: Nishka Dasgupta
  Cc: w.d.hubbs, chris, kirk, samuel.thibault, gregkh, outreachy-kernel



On Wed, 20 Mar 2019, 'Nishka Dasgupta' via outreachy-kernel wrote:

> Remove return variable and return the required value directly. Issue
> suggested by Coccinelle using ret.cocci.
>
> Signed-off-by: Nishka Dasgupta <nishka.dasgupta@yahoo.com>
> ---
>  drivers/staging/speakup/i18n.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/staging/speakup/i18n.c b/drivers/staging/speakup/i18n.c
> index ee240d36f947..a748eb8052d1 100644
> --- a/drivers/staging/speakup/i18n.c
> +++ b/drivers/staging/speakup/i18n.c
> @@ -470,8 +470,7 @@ static char *find_specifier_end(char *input)
>  	input++;		/* Advance over %. */
>  	input = skip_flags(input);
>  	input = skip_width(input);
> -	input = skip_conversion(input);
> -	return input;
> +	return skip_conversion(input);

The maintainer has already said that he prefers the parallelism of an
assignment on input in each case.

julia

>  }
>
>  /*
> --
> 2.19.1
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20190319193722.9561-1-nishka.dasgupta%40yahoo.com.
> For more options, visit https://groups.google.com/d/optout.
>


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

* Re: [PATCH] staging: speakup: Remove return variable
  2019-03-19 19:37 [PATCH] staging: speakup: Remove return variable Nishka Dasgupta
  2019-03-19 20:01 ` [Outreachy kernel] " Julia Lawall
@ 2019-03-19 22:05 ` Samuel Thibault
  2019-03-20 15:55   ` NIshka Dasgupta
  1 sibling, 1 reply; 4+ messages in thread
From: Samuel Thibault @ 2019-03-19 22:05 UTC (permalink / raw)
  To: Nishka Dasgupta; +Cc: w.d.hubbs, chris, kirk, gregkh, outreachy-kernel

Nishka Dasgupta, le mer. 20 mars 2019 01:07:22 +0530, a ecrit:
> Remove return variable and return the required value directly. Issue
> suggested by Coccinelle using ret.cocci.

Well, I have to say that for style I prefer the way it was: we apply
several functions to the input variable, before returning it.

> Signed-off-by: Nishka Dasgupta <nishka.dasgupta@yahoo.com>
> ---
>  drivers/staging/speakup/i18n.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/speakup/i18n.c b/drivers/staging/speakup/i18n.c
> index ee240d36f947..a748eb8052d1 100644
> --- a/drivers/staging/speakup/i18n.c
> +++ b/drivers/staging/speakup/i18n.c
> @@ -470,8 +470,7 @@ static char *find_specifier_end(char *input)
>  	input++;		/* Advance over %. */
>  	input = skip_flags(input);
>  	input = skip_width(input);
> -	input = skip_conversion(input);
> -	return input;
> +	return skip_conversion(input);
>  }
>  
>  /*
> -- 
> 2.19.1
> 

-- 
Samuel
<s> je la connaissais pas celle la : "make: Entering an unknown directory"
 -+- #ens-mim -+-


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

* Re: [PATCH] staging: speakup: Remove return variable
  2019-03-19 22:05 ` Samuel Thibault
@ 2019-03-20 15:55   ` NIshka Dasgupta
  0 siblings, 0 replies; 4+ messages in thread
From: NIshka Dasgupta @ 2019-03-20 15:55 UTC (permalink / raw)
  To: Samuel Thibault; +Cc: w.d.hubbs, chris, kirk, gregkh, outreachy-kernel



On 20/03/19 3:35 AM, Samuel Thibault wrote:
> Nishka Dasgupta, le mer. 20 mars 2019 01:07:22 +0530, a ecrit:
>> Remove return variable and return the required value directly. Issue
>> suggested by Coccinelle using ret.cocci.
> 
> Well, I have to say that for style I prefer the way it was: we apply
> several functions to the input variable, before returning it.

I apologise; I did not know. I will not submit this kind of patch for 
this driver in future.
- Nishka
>> Signed-off-by: Nishka Dasgupta <nishka.dasgupta@yahoo.com>
>> ---
>>   drivers/staging/speakup/i18n.c | 3 +--
>>   1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/drivers/staging/speakup/i18n.c b/drivers/staging/speakup/i18n.c
>> index ee240d36f947..a748eb8052d1 100644
>> --- a/drivers/staging/speakup/i18n.c
>> +++ b/drivers/staging/speakup/i18n.c
>> @@ -470,8 +470,7 @@ static char *find_specifier_end(char *input)
>>   	input++;		/* Advance over %. */
>>   	input = skip_flags(input);
>>   	input = skip_width(input);
>> -	input = skip_conversion(input);
>> -	return input;
>> +	return skip_conversion(input);
>>   }
>>   
>>   /*
>> -- 
>> 2.19.1
>>
> 


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

end of thread, other threads:[~2019-03-20 15:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-19 19:37 [PATCH] staging: speakup: Remove return variable Nishka Dasgupta
2019-03-19 20:01 ` [Outreachy kernel] " Julia Lawall
2019-03-19 22:05 ` Samuel Thibault
2019-03-20 15:55   ` NIshka Dasgupta

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.