Skip to contentSkip to conversation

staging: speakup: Remove return variable

PATCH In review Nishka Dasgupta 3 participants 4 messages Mar 19, 2019 – Mar 20, 2019 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: speakup: Remove return variable

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

---
 drivers/staging/speakup/i18n.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/speakup/i18n.c +1 -2
index ee240d36f947..a748eb8052d1 100644
@@ -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);
 }
 
 /*
Signature · 1 line
2.19.1
#1 lore raw
Quoted 13 lines · Nishka Dasgupta' via outreachy-kernel

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

---
 drivers/staging/speakup/i18n.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/speakup/i18n.c +0 -0
index ee240d36f947..a748eb8052d1 100644

drivers/staging/speakup/i18n.c static char *find_specifier_end(char *input) · line 473

Quoted 6 lines
drivers/staging/speakup/i18n.c +1 -2
@@ -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

Quoted 13 lines
drivers/staging/speakup/i18n.c +0 -1
 }
 
 /*
--

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 [email protected]. To post to this group, send email to [email protected].
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.

#2 lore raw
In reply to Nishka Dasgupta

Nishka Dasgupta, le mer. 20 mars 2019 01:07:22 +0530, a ecrit:

Quoted 2 lines

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.

Quoted 22 lines
---
 drivers/staging/speakup/i18n.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/speakup/i18n.c +1 -2
index ee240d36f947..a748eb8052d1 100644
@@ -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);
 }
 
 /*
Signature · 1 line
2.19.1
Signature · 3 lines
Samuel
<s> je la connaissais pas celle la : "make: Entering an unknown directory"
 -+- #ens-mim -+-
#3 lore raw
Quoted 6 lines · Samuel Thibault

Nishka Dasgupta, le mer. 20 mars 2019 01:07:22 +0530, a ecrit:

Quoted 2 lines

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

Quoted 23 lines
Quoted 22 lines
---
  drivers/staging/speakup/i18n.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/speakup/i18n.c +1 -2
index ee240d36f947..a748eb8052d1 100644
@@ -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);
  }
 
  /*
Signature · 1 line
2.19.1