All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3/3] staging:speakup:keyhelp.c: Remove unnecessary else
@ 2017-03-05 19:37 Tamara Diaconita
  2017-03-05 20:10 ` Samuel Thibault
  2017-03-06 11:29 ` Tamara Diaconita
  0 siblings, 2 replies; 7+ messages in thread
From: Tamara Diaconita @ 2017-03-05 19:37 UTC (permalink / raw)
  To: w.d.hubbs, chris, kirk, samuel.thibault, gregkh, outreachy-kernel
  Cc: Tamara Diaconita

Fixed the checkpath.pl WARNING:
Else is not generally useful after a break return.

Deleted the 'else' structure.
Deleted extra tabs which remained after the 'else' structure was
removed.

Signed-off-by: Tamara Diaconita <diaconita.tamara@gmail.com>
---
 drivers/staging/speakup/keyhelp.c | 44 +++++++++++++++++++--------------------
 1 file changed, 22 insertions(+), 22 deletions(-)

diff --git a/drivers/staging/speakup/keyhelp.c b/drivers/staging/speakup/keyhelp.c
index 2ef7370..0e0efc46 100644
--- a/drivers/staging/speakup/keyhelp.c
+++ b/drivers/staging/speakup/keyhelp.c
@@ -176,30 +176,30 @@ int spk_handle_help(struct vc_data *vc, u_char type, u_char ch, u_short key)
 		synth_printf("%s\n", spk_msg_get(MSG_HELP_INFO));
 		build_key_data(); /* rebuild each time in case new mapping */
 		return 1;
-	} else {
-		name = NULL;
-		if ((type != KT_SPKUP) && (key > 0) && (key <= num_key_names)) {
-			synth_printf("%s\n",
-				     spk_msg_get(MSG_KEYNAMES_START + key - 1));
-			return 1;
-		}
-		for (i = 0; funcvals[i] != 0 && !name; i++) {
-			if (ch == funcvals[i])
-				name = spk_msg_get(MSG_FUNCNAMES_START + i);
-		}
-		if (!name)
-			return -1;
-		kp = spk_our_keys[key] + 1;
-		for (i = 0; i < nstates; i++) {
-			if (ch == kp[i])
-				break;
-		}
-		key += (state_tbl[i] << 8);
-		say_key(key);
-		synth_printf(spk_msg_get(MSG_KEYDESC), name);
-		synth_printf("\n");
+	}
+	name = NULL;
+	if ((type != KT_SPKUP) && (key > 0) && (key <= num_key_names)) {
+		synth_printf("%s\n",
+			     spk_msg_get(MSG_KEYNAMES_START + key - 1));
 		return 1;
 	}
+	for (i = 0; funcvals[i] != 0 && !name; i++) {
+		if (ch == funcvals[i])
+			name = spk_msg_get(MSG_FUNCNAMES_START + i);
+	}
+	if (!name)
+		return -1;
+	kp = spk_our_keys[key] + 1;
+	for (i = 0; i < nstates; i++) {
+		if (ch == kp[i])
+			break;
+		}
+	key += (state_tbl[i] << 8);
+	say_key(key);
+	synth_printf(spk_msg_get(MSG_KEYDESC), name);
+	synth_printf("\n");
+	return 1;
+
 	name = spk_msg_get(MSG_FUNCNAMES_START + cur_item);
 	func = funcvals[cur_item];
 	synth_printf("%s", name);
-- 
2.9.3



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

end of thread, other threads:[~2017-03-06 13:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-05 19:37 [PATCH 3/3] staging:speakup:keyhelp.c: Remove unnecessary else Tamara Diaconita
2017-03-05 20:10 ` Samuel Thibault
2017-03-06 11:29 ` Tamara Diaconita
2017-03-06 11:41   ` [Outreachy kernel] " Julia Lawall
2017-03-06 13:46     ` Tamara Diaconita
2017-03-06 13:50       ` Julia Lawall
2017-03-06 11:41   ` Daniel Baluta

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.