Skip to contentSkip to conversation

staging: speakup: compress return logic into one line

PATCH In review Alison Schofield 2 participants 2 messages Feb 10, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: speakup: compress return logic into one line

Simplify function return by merging assignment and return into one command line. Remove (now) unused local variable.

Found using Coccinelle:
@@
expression e, ret;
@@

-ret =
+return

	e;

-return ret;

---
 drivers/staging/speakup/i18n.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/staging/speakup/i18n.c +1 -4
index 12f880e..8960079 100644
@@ -393,10 +393,7 @@ static const  int num_groups = ARRAY_SIZE(all_groups);
 
 char *spk_msg_get(enum msg_index_t index)
 {
-	char *ch;
-
-	ch = speakup_msgs[index];
-	return ch;
+	return speakup_msgs[index];
 }
 
 /*
Signature · 1 line
2.1.4
Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · Alison Schofield

Simplify function return by merging assignment and return into one command line. Remove (now) unused local variable.

Found using Coccinelle:
@@
expression e, ret;
@@

(quoted diff) +1 -1
-ret =
+return
	e;
Quoted 3 lines

-return ret;

Quoted 30 lines
---
 drivers/staging/speakup/i18n.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/staging/speakup/i18n.c +1 -4
index 12f880e..8960079 100644
@@ -393,10 +393,7 @@ static const  int num_groups = ARRAY_SIZE(all_groups);
 
 char *spk_msg_get(enum msg_index_t index)
 {
-	char *ch;
-
-	ch = speakup_msgs[index];
-	return ch;
+	return speakup_msgs[index];
 }
 
 /*
Signature · 8 lines
2.1.4

-- 
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/20160210185723.GA15085%40d830.WORKGROUP.
For more options, visit https://groups.google.com/d/optout.