staging: speakup: compress return logic into one line
Author: Alison Schofield <amsfield22@gmail.com>
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;
Signed-off-by: Alison Schofield
Acked-by: Julia Lawall
Signed-off-by: Greg Kroah-Hartman
---
drivers/staging/speakup/i18n.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/staging/speakup/i18n.c b/drivers/staging/speakup/i18n.c
index 12f880e..8960079 100644
--- a/drivers/staging/speakup/i18n.c
+++ b/drivers/staging/speakup/i18n.c
@@ -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];
}
/* |
---
drivers/staging/speakup/i18n.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/staging/speakup/i18n.c b/drivers/staging/speakup/i18n.c
index 12f880e..8960079 100644
--- a/drivers/staging/speakup/i18n.c
+++ b/drivers/staging/speakup/i18n.c
@@ -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];
}
/*