All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2 v5] Align with parentheses and clean if tests
@ 2017-02-28 21:08 Sreya Mittal
  2017-02-28 21:08 ` [PATCH 1/2 v5] staging: speakup: Align with parentheses Sreya Mittal
  2017-02-28 21:08 ` [PATCH 2/2 v5] staging: speakup: Clean up if conditions Sreya Mittal
  0 siblings, 2 replies; 3+ messages in thread
From: Sreya Mittal @ 2017-02-28 21:08 UTC (permalink / raw)
  To: outreachy-kernel
  Cc: Sreya Mittal, William Hubbs, Chris Brannon, Kirk Reiser,
	Samuel Thibault, Greg Kroah-Hartman

Align the print statements with the
open parentheses and
put logical operands on the previous line

Sreya Mittal (2):
  staging: speakup: Align with parentheses
  staging: speakup: Clean up if conditions

 drivers/staging/speakup/keyhelp.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

-- 
2.9.3



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

* [PATCH 1/2 v5] staging: speakup: Align with parentheses
  2017-02-28 21:08 [PATCH 0/2 v5] Align with parentheses and clean if tests Sreya Mittal
@ 2017-02-28 21:08 ` Sreya Mittal
  2017-02-28 21:08 ` [PATCH 2/2 v5] staging: speakup: Clean up if conditions Sreya Mittal
  1 sibling, 0 replies; 3+ messages in thread
From: Sreya Mittal @ 2017-02-28 21:08 UTC (permalink / raw)
  To: outreachy-kernel
  Cc: Sreya Mittal, William Hubbs, Chris Brannon, Kirk Reiser,
	Samuel Thibault, Greg Kroah-Hartman

Align next line of print statements
to the right of open parentheses.

Signed-off-by: Sreya Mittal <sreyamittal5@gmail.com>
---

Changes in v5:
*Add the removed parentheses back

 drivers/staging/speakup/keyhelp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/speakup/keyhelp.c b/drivers/staging/speakup/keyhelp.c
index ce94cb1..f5156bb 100644
--- a/drivers/staging/speakup/keyhelp.c
+++ b/drivers/staging/speakup/keyhelp.c
@@ -117,7 +117,7 @@ static void say_key(int key)
 	}
 	if ((key > 0) && (key <= num_key_names))
 		synth_printf(" %s\n",
-				spk_msg_get(MSG_KEYNAMES_START + (key - 1)));
+			     spk_msg_get(MSG_KEYNAMES_START + (key - 1)));
 }
 
 static int help_init(void)
@@ -182,7 +182,7 @@ int spk_handle_help(struct vc_data *vc, u_char type, u_char ch, u_short key)
 		name = NULL;
 		if ((type != KT_SPKUP) && (key > 0) && (key <= num_key_names)) {
 			synth_printf("%s\n",
-				spk_msg_get(MSG_KEYNAMES_START + key - 1));
+				     spk_msg_get(MSG_KEYNAMES_START + key - 1));
 			return 1;
 		}
 		for (i = 0; funcvals[i] != 0 && !name; i++) {
-- 
2.9.3



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

* [PATCH 2/2 v5] staging: speakup: Clean up if conditions
  2017-02-28 21:08 [PATCH 0/2 v5] Align with parentheses and clean if tests Sreya Mittal
  2017-02-28 21:08 ` [PATCH 1/2 v5] staging: speakup: Align with parentheses Sreya Mittal
@ 2017-02-28 21:08 ` Sreya Mittal
  1 sibling, 0 replies; 3+ messages in thread
From: Sreya Mittal @ 2017-02-28 21:08 UTC (permalink / raw)
  To: outreachy-kernel
  Cc: Sreya Mittal, William Hubbs, Chris Brannon, Kirk Reiser,
	Samuel Thibault, Greg Kroah-Hartman

Found by checkpatch.pl
Logical conditions are on the next line, useless parentheses present
Clean up the if tests by

* Put logical conditions on the previous line
* Line up the tests

Signed-off-by: Sreya Mittal <sreyamittal5@gmail.com>
---

Changes in v5:
No change in this patch.

 drivers/staging/speakup/keyhelp.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/speakup/keyhelp.c b/drivers/staging/speakup/keyhelp.c
index f5156bb..4e6e5da 100644
--- a/drivers/staging/speakup/keyhelp.c
+++ b/drivers/staging/speakup/keyhelp.c
@@ -163,17 +163,15 @@ int spk_handle_help(struct vc_data *vc, u_char type, u_char ch, u_short key)
 		}
 		cur_item = letter_offsets[ch - 'a'];
 	} else if (type == KT_CUR) {
-		if (ch == 0
-		    && (MSG_FUNCNAMES_START + cur_item + 1) <=
-		    MSG_FUNCNAMES_END)
+		if (ch == 0 &&
+		    (MSG_FUNCNAMES_START + cur_item + 1) <= MSG_FUNCNAMES_END)
 			cur_item++;
 		else if (ch == 3 && cur_item > 0)
 			cur_item--;
 		else
 			return -1;
-	} else if (type == KT_SPKUP
-			&& ch == SPEAKUP_HELP
-			&& !spk_special_handler) {
+	} 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 */
-- 
2.9.3



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

end of thread, other threads:[~2017-02-28 21:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-28 21:08 [PATCH 0/2 v5] Align with parentheses and clean if tests Sreya Mittal
2017-02-28 21:08 ` [PATCH 1/2 v5] staging: speakup: Align with parentheses Sreya Mittal
2017-02-28 21:08 ` [PATCH 2/2 v5] staging: speakup: Clean up if conditions Sreya Mittal

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.