All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Staging: speakup: Change else-if block order
@ 2019-03-12  9:15 Wentao Cai
  2019-03-12  9:54 ` Samuel Thibault
  2019-03-12 10:16 ` [Outreachy kernel] " Julia Lawall
  0 siblings, 2 replies; 5+ messages in thread
From: Wentao Cai @ 2019-03-12  9:15 UTC (permalink / raw)
  To: William Hubbs, Chris Brannon, Kirk Reiser, Samuel Thibault,
	Greg Kroah-Hartman
  Cc: outreachy-kernel, Wentao Cai

Change else-if block to silence checkpatch.pl warning:
WARNING: else is not generally useful after a break or return

Signed-off-by: Wentao Cai <etsai042@gmail.com>
---
 drivers/staging/speakup/keyhelp.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/speakup/keyhelp.c b/drivers/staging/speakup/keyhelp.c
index 5f1bda37f86d..23ec8f01e0a2 100644
--- a/drivers/staging/speakup/keyhelp.c
+++ b/drivers/staging/speakup/keyhelp.c
@@ -153,6 +153,12 @@ int spk_handle_help(struct vc_data *vc, u_char type, u_char ch, u_short key)
 			return 1;
 		}
 		cur_item = letter_offsets[ch - 'a'];
+	} else if (type == KT_SPKUP && ch == SPEAKUP_HELP &&
+		   !spk_special_handler) {
+		spk_special_handler = spk_handle_help;
+		synth_printf("%s\n", spk_msg_get(MSG_HELP_INFO));
+		build_key_data(); /* rebuild each time in case new mapping */
+		return 1;
 	} else if (type == KT_CUR) {
 		if (ch == 0 &&
 		    (MSG_FUNCNAMES_START + cur_item + 1) <= MSG_FUNCNAMES_END)
@@ -161,12 +167,6 @@ int spk_handle_help(struct vc_data *vc, u_char type, u_char ch, u_short key)
 			cur_item--;
 		else
 			return -1;
-	} else if (type == KT_SPKUP && ch == SPEAKUP_HELP &&
-		   !spk_special_handler) {
-		spk_special_handler = spk_handle_help;
-		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)) {
-- 
2.11.0



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

end of thread, other threads:[~2019-03-12 14:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-12  9:15 [PATCH] Staging: speakup: Change else-if block order Wentao Cai
2019-03-12  9:54 ` Samuel Thibault
2019-03-12 10:16 ` [Outreachy kernel] " Julia Lawall
2019-03-12 14:30   ` etsai042
2019-03-12 14:38     ` Julia Lawall

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.