linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RESEND PATCH 00/11] staging:speakup: Multiple Checkpatch issues.
@ 2017-03-21 11:42 Arushi Singhal
  2017-03-21 11:42 ` [PATCH 01/11] staging: speakup: Moved logical to previous line Arushi Singhal
                   ` (11 more replies)
  0 siblings, 12 replies; 17+ messages in thread
From: Arushi Singhal @ 2017-03-21 11:42 UTC (permalink / raw)
  To: w.d.hubbs
  Cc: chris, outreachy-kernel, kirk, samuel.thibault, gregkh, speakup,
	devel, linux-kernel, Arushi Singhal

Improve readability by fixing multiple checkpatch.pl
issues in speakup driver.

Arushi Singhal (11):
  staging: speakup: Moved logical to previous line.
  staging: speakup: Remove multiple assignments
  staging: speakup: Simplify "NULL" comparisons
  staging: speakup: fixes braces {} should be used on all arms of this
    statement
  staging: speakup: Remove multiple assignments
  staging: speakup: Moved OR operator to previous line.
  staging: speakup: spaces preferred around operator
  staging: speakup: Removed Unnecessary parentheses.
  staging: speakup: Simplify the NULL comparisons
  staging: speakup: Match alignment with open parenthesis.
  staging: speakup: Fix alignment with parenthesis.

 drivers/staging/speakup/fakekey.c        |   2 +-
 drivers/staging/speakup/kobjects.c       |   2 +-
 drivers/staging/speakup/main.c           | 110 +++++++++++++++++--------------
 drivers/staging/speakup/selection.c      |   4 +-
 drivers/staging/speakup/serialio.c       |   2 +-
 drivers/staging/speakup/speakup.h        |  12 ++--
 drivers/staging/speakup/speakup_acntpc.c |   8 +--
 drivers/staging/speakup/speakup_apollo.c |   2 +-
 drivers/staging/speakup/speakup_decext.c |  10 +--
 drivers/staging/speakup/speakup_decpc.c  |  26 ++++----
 drivers/staging/speakup/speakup_dectlk.c |   6 +-
 drivers/staging/speakup/speakup_dtlk.c   |   2 +-
 drivers/staging/speakup/speakup_keypc.c  |   6 +-
 drivers/staging/speakup/speakup_ltlk.c   |   2 +-
 drivers/staging/speakup/varhandlers.c    |  18 ++---
 15 files changed, 114 insertions(+), 98 deletions(-)

-- 
2.11.0

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

* [PATCH 01/11] staging: speakup: Moved logical to previous line.
  2017-03-21 11:42 [RESEND PATCH 00/11] staging:speakup: Multiple Checkpatch issues Arushi Singhal
@ 2017-03-21 11:42 ` Arushi Singhal
  2017-03-21 11:42 ` [PATCH 02/11] staging: speakup: Remove multiple assignments Arushi Singhal
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 17+ messages in thread
From: Arushi Singhal @ 2017-03-21 11:42 UTC (permalink / raw)
  To: w.d.hubbs
  Cc: chris, outreachy-kernel, kirk, samuel.thibault, gregkh, speakup,
	devel, linux-kernel, Arushi Singhal

Moved logical operator to previous line to fix the following
checkpatch issue:

CHECK: Logical continuations should be on the previous line.

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
---
 drivers/staging/speakup/main.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c
index f280e22d7e15..f71206878363 100644
--- a/drivers/staging/speakup/main.c
+++ b/drivers/staging/speakup/main.c
@@ -905,8 +905,8 @@ static int get_sentence_buf(struct vc_data *vc, int read_punc)
 	while (start < end) {
 		sentbuf[bn][i] = get_char(vc, (u_short *)start, &tmp);
 		if (i > 0) {
-			if (sentbuf[bn][i] == SPACE && sentbuf[bn][i - 1] == '.'
-			    && numsentences[bn] < 9) {
+			if (sentbuf[bn][i] == SPACE && sentbuf[bn][i - 1] == '.' &&
+			    numsentences[bn] < 9) {
 				/* Sentence Marker */
 				numsentences[bn]++;
 				sentmarks[bn][numsentences[bn]] =
@@ -1292,8 +1292,8 @@ void spk_reset_default_chars(void)
 
 	/* First, free any non-default */
 	for (i = 0; i < 256; i++) {
-		if ((spk_characters[i] != NULL)
-		    && (spk_characters[i] != spk_default_chars[i]))
+		if (spk_characters[i] &&
+		    (spk_characters[i] != spk_default_chars[i]))
 			kfree(spk_characters[i]);
 	}
 
@@ -2088,8 +2088,8 @@ speakup_key(struct vc_data *vc, int shift_state, int keycode, u_short keysym,
 	tty = vc->port.tty;
 	if (type >= 0xf0)
 		type -= 0xf0;
-	if (type == KT_PAD
-		&& (vt_get_leds(fg_console, VC_NUMLOCK))) {
+	if (type == KT_PAD &&
+	    (vt_get_leds(fg_console, VC_NUMLOCK))) {
 		if (up_flag) {
 			spk_keydown = 0;
 			goto out;
-- 
2.11.0

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

* [PATCH 02/11] staging: speakup: Remove multiple assignments
  2017-03-21 11:42 [RESEND PATCH 00/11] staging:speakup: Multiple Checkpatch issues Arushi Singhal
  2017-03-21 11:42 ` [PATCH 01/11] staging: speakup: Moved logical to previous line Arushi Singhal
@ 2017-03-21 11:42 ` Arushi Singhal
  2017-03-23 13:18   ` Greg KH
  2017-03-21 11:42 ` [PATCH 03/11] staging: speakup: Simplify "NULL" comparisons Arushi Singhal
                   ` (9 subsequent siblings)
  11 siblings, 1 reply; 17+ messages in thread
From: Arushi Singhal @ 2017-03-21 11:42 UTC (permalink / raw)
  To: w.d.hubbs
  Cc: chris, outreachy-kernel, kirk, samuel.thibault, gregkh, speakup,
	devel, linux-kernel, Arushi Singhal

This patch fixes the checkpatch.pl warning "multiple assignments
should be avoided."

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
---
 drivers/staging/speakup/main.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c
index f71206878363..f8fccc8bf6b2 100644
--- a/drivers/staging/speakup/main.c
+++ b/drivers/staging/speakup/main.c
@@ -270,9 +270,12 @@ static unsigned char get_attributes(struct vc_data *vc, u16 *pos)
 
 static void speakup_date(struct vc_data *vc)
 {
-	spk_x = spk_cx = vc->vc_x;
-	spk_y = spk_cy = vc->vc_y;
-	spk_pos = spk_cp = vc->vc_pos;
+	spk_x = vc->vc_x;
+	spk_cx = spk_x;
+	spk_y = vc->vc_y;
+	spk_cy = spk_y;
+	spk_pos = vc->vc_pos;
+	spk_cp = spk_pos;
 	spk_old_attr = spk_attr;
 	spk_attr = get_attributes(vc, (u_short *)spk_pos);
 }
@@ -1655,9 +1658,12 @@ static int speak_highlight(struct vc_data *vc)
 		spk_do_flush();
 		spkup_write(speakup_console[vc_num]->ht.highbuf[hc],
 			    speakup_console[vc_num]->ht.highsize[hc]);
-		spk_pos = spk_cp = speakup_console[vc_num]->ht.rpos[hc];
-		spk_x = spk_cx = speakup_console[vc_num]->ht.rx[hc];
-		spk_y = spk_cy = speakup_console[vc_num]->ht.ry[hc];
+		spk_pos = speakup_console[vc_num]->ht.rpos[hc];
+		spk_cp = spk_pos;
+		spk_x = speakup_console[vc_num]->ht.rx[hc];
+		spk_cx = spk_x;
+		spk_y = speakup_console[vc_num]->ht.ry[hc];
+		spk_cy = spk_y;
 		return 1;
 	}
 	return 0;
-- 
2.11.0

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

* [PATCH 03/11] staging: speakup: Simplify "NULL" comparisons
  2017-03-21 11:42 [RESEND PATCH 00/11] staging:speakup: Multiple Checkpatch issues Arushi Singhal
  2017-03-21 11:42 ` [PATCH 01/11] staging: speakup: Moved logical to previous line Arushi Singhal
  2017-03-21 11:42 ` [PATCH 02/11] staging: speakup: Remove multiple assignments Arushi Singhal
@ 2017-03-21 11:42 ` Arushi Singhal
  2017-03-21 11:42 ` [PATCH 04/11] staging: speakup: fixes braces {} should be used on all arms of this statement Arushi Singhal
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 17+ messages in thread
From: Arushi Singhal @ 2017-03-21 11:42 UTC (permalink / raw)
  To: w.d.hubbs
  Cc: chris, outreachy-kernel, kirk, samuel.thibault, gregkh, speakup,
	devel, linux-kernel, Arushi Singhal

Fixed coding style for null comparisons in speakup driver to be more
consistant with the rest of the kernel coding style.
Replaced 'x != NULL' with 'x' and 'x = NULL' with '!x'.

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
---
 drivers/staging/speakup/selection.c   | 2 +-
 drivers/staging/speakup/varhandlers.c | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/speakup/selection.c b/drivers/staging/speakup/selection.c
index afd9a446a06f..4417c00e68a7 100644
--- a/drivers/staging/speakup/selection.c
+++ b/drivers/staging/speakup/selection.c
@@ -175,7 +175,7 @@ static struct speakup_paste_work speakup_paste_work = {
 
 int speakup_paste_selection(struct tty_struct *tty)
 {
-	if (cmpxchg(&speakup_paste_work.tty, NULL, tty) != NULL)
+	if (cmpxchg(&speakup_paste_work.tty, NULL, tty))
 		return -EBUSY;
 
 	tty_kref_get(tty);
diff --git a/drivers/staging/speakup/varhandlers.c b/drivers/staging/speakup/varhandlers.c
index cc984196020f..5910fe0b1365 100644
--- a/drivers/staging/speakup/varhandlers.c
+++ b/drivers/staging/speakup/varhandlers.c
@@ -98,7 +98,7 @@ void speakup_register_var(struct var_t *var)
 		}
 	}
 	p_header = var_ptrs[var->var_id];
-	if (p_header->data != NULL)
+	if (p_header->data)
 		return;
 	p_header->data = var;
 	switch (p_header->var_type) {
@@ -210,11 +210,11 @@ int spk_set_num_var(int input, struct st_var_header *var, int how)
 		return -ERANGE;
 
 	var_data->u.n.value = val;
-	if (var->var_type == VAR_TIME && p_val != NULL) {
+	if (var->var_type == VAR_TIME && p_val) {
 		*p_val = msecs_to_jiffies(val);
 		return 0;
 	}
-	if (p_val != NULL)
+	if (p_val)
 		*p_val = val;
 	if (var->var_id == PUNC_LEVEL) {
 		spk_punc_mask = spk_punc_masks[val];
-- 
2.11.0

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

* [PATCH 04/11] staging: speakup: fixes braces {} should be used on all arms of this statement
  2017-03-21 11:42 [RESEND PATCH 00/11] staging:speakup: Multiple Checkpatch issues Arushi Singhal
                   ` (2 preceding siblings ...)
  2017-03-21 11:42 ` [PATCH 03/11] staging: speakup: Simplify "NULL" comparisons Arushi Singhal
@ 2017-03-21 11:42 ` Arushi Singhal
  2017-03-21 11:42 ` [PATCH 05/11] staging: speakup: Remove multiple assignments Arushi Singhal
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 17+ messages in thread
From: Arushi Singhal @ 2017-03-21 11:42 UTC (permalink / raw)
  To: w.d.hubbs
  Cc: chris, outreachy-kernel, kirk, samuel.thibault, gregkh, speakup,
	devel, linux-kernel, Arushi Singhal

This patch fixes the checks reported by checkpatch.pl
for braces {} should be used on all arms of this statement.

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
---
 drivers/staging/speakup/main.c           | 35 +++++++++++++++++++-------------
 drivers/staging/speakup/speakup_decext.c |  6 +++---
 drivers/staging/speakup/speakup_decpc.c  |  6 +++---
 drivers/staging/speakup/speakup_dectlk.c |  6 +++---
 drivers/staging/speakup/varhandlers.c    | 12 ++++++-----
 5 files changed, 37 insertions(+), 28 deletions(-)

diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c
index f8fccc8bf6b2..21e76b031449 100644
--- a/drivers/staging/speakup/main.c
+++ b/drivers/staging/speakup/main.c
@@ -409,8 +409,9 @@ static void say_attributes(struct vc_data *vc)
 	if (bg > 7) {
 		synth_printf(" %s ", spk_msg_get(MSG_ON_BLINKING));
 		bg -= 8;
-	} else
+	} else {
 		synth_printf(" %s ", spk_msg_get(MSG_ON));
+	}
 	synth_printf("%s\n", spk_msg_get(MSG_COLORS_START + bg));
 }
 
@@ -643,8 +644,9 @@ static void say_prev_word(struct vc_data *vc)
 				break;
 			spk_y--;
 			spk_x = vc->vc_cols - 1;
-		} else
+		} else {
 			spk_x--;
+		}
 		spk_pos -= 2;
 		ch = get_char(vc, (u_short *)spk_pos, &temp);
 		if (ch == SPACE || ch == 0)
@@ -697,8 +699,9 @@ static void say_next_word(struct vc_data *vc)
 			spk_y++;
 			spk_x = 0;
 			edge_said = edge_right;
-		} else
+		} else {
 			spk_x++;
+		}
 		spk_pos += 2;
 		last_state = state;
 	}
@@ -729,8 +732,9 @@ static void spell_word(struct vc_data *vc)
 				spk_pitch_shift++;
 			else	/* synth has no pitch */
 				last_cap = spk_str_caps_stop;
-		} else
+		} else {
 			str_cap = spk_str_caps_stop;
+		}
 		if (str_cap != last_cap) {
 			synth_printf("%s", str_cap);
 			last_cap = str_cap;
@@ -1343,8 +1347,9 @@ static int speakup_allocate(struct vc_data *vc)
 		if (!speakup_console[vc_num])
 			return -ENOMEM;
 		speakup_date(vc);
-	} else if (!spk_parked)
+	} else if (!spk_parked) {
 		speakup_date(vc);
+	}
 
 	return 0;
 }
@@ -1397,9 +1402,9 @@ static void read_all_doc(struct vc_data *vc)
 		prev_cursor_track = cursor_track;
 	cursor_track = read_all_mode;
 	spk_reset_index_count(0);
-	if (get_sentence_buf(vc, 0) == -1)
+	if (get_sentence_buf(vc, 0) == -1) {
 		kbd_fakekey2(vc, RA_DOWN_ARROW);
-	else {
+	} else {
 		say_sentence_num(0, 0);
 		synth_insert_next_index(0);
 		start_read_all_timer(vc, RA_TIMER);
@@ -1446,8 +1451,9 @@ static void handle_cursor_read_all(struct vc_data *vc, int command)
 			if (!say_sentence_num(sentcount + 1, 1)) {
 				sn = 1;
 				spk_reset_index_count(sn);
-			} else
+			} else {
 				synth_insert_next_index(0);
+			}
 			if (!say_sentence_num(sn, 0)) {
 				kbd_fakekey2(vc, RA_FIND_NEXT_SENT);
 				return;
@@ -1476,9 +1482,9 @@ static void handle_cursor_read_all(struct vc_data *vc, int command)
 		rv = get_sentence_buf(vc, 0);
 		if (rv == -1)
 			read_all_doc(vc);
-		if (rv == 0)
+		if (rv == 0) {
 			kbd_fakekey2(vc, RA_FIND_NEXT_SENT);
-		else {
+		} else {
 			say_sentence_num(1, 0);
 			synth_insert_next_index(0);
 			start_read_all_timer(vc, RA_TIMER);
@@ -2177,10 +2183,11 @@ speakup_key(struct vc_data *vc, int shift_state, int keycode, u_short keysym,
 		if (type == KT_SPEC && value == 1) {
 			value = '\n';
 			type = KT_LATIN;
-		} else if (type == KT_LETTER)
+		} else if (type == KT_LETTER) {
 			type = KT_LATIN;
-		else if (value == 0x7f)
+		} else if (value == 0x7f) {
 			value = 8;	/* make del = backspace */
+		}
 		ret = (*spk_special_handler) (vc, type, value, keycode);
 		spk_close_press = 0;
 		if (ret < 0)
@@ -2274,9 +2281,9 @@ static int vt_notifier_call(struct notifier_block *nb,
 		speakup_deallocate(vc);
 		break;
 	case VT_WRITE:
-		if (param->c == '\b')
+		if (param->c == '\b') {
 			speakup_bs(vc);
-		else {
+		} else {
 			u16 d = param->c;
 			speakup_con_write(vc, &d, 1);
 		}
diff --git a/drivers/staging/speakup/speakup_decext.c b/drivers/staging/speakup/speakup_decext.c
index fdbf330cae4e..929a28d618dc 100644
--- a/drivers/staging/speakup/speakup_decext.c
+++ b/drivers/staging/speakup/speakup_decext.c
@@ -195,11 +195,11 @@ static void do_catch_up(struct spk_synth *synth)
 		spin_lock_irqsave(&speakup_info.spinlock, flags);
 		synth_buffer_getc();
 		spin_unlock_irqrestore(&speakup_info.spinlock, flags);
-		if (ch == '[')
+		if (ch == '[') {
 			in_escape = 1;
-		else if (ch == ']')
+		} else if (ch == ']') {
 			in_escape = 0;
-		else if (ch <= SPACE) {
+		} else if (ch <= SPACE) {
 			if (!in_escape && strchr(",.!?;:", last))
 				synth->io_ops->synth_out(synth, PROCSPEECH);
 			if (time_after_eq(jiffies, jiff_max)) {
diff --git a/drivers/staging/speakup/speakup_decpc.c b/drivers/staging/speakup/speakup_decpc.c
index 2a738be19789..5e35d7e11361 100644
--- a/drivers/staging/speakup/speakup_decpc.c
+++ b/drivers/staging/speakup/speakup_decpc.c
@@ -410,11 +410,11 @@ static void do_catch_up(struct spk_synth *synth)
 		spin_lock_irqsave(&speakup_info.spinlock, flags);
 		synth_buffer_getc();
 		spin_unlock_irqrestore(&speakup_info.spinlock, flags);
-		if (ch == '[')
+		if (ch == '[') {
 			in_escape = 1;
-		else if (ch == ']')
+		} else if (ch == ']') {
 			in_escape = 0;
-		else if (ch <= SPACE) {
+		} else if (ch <= SPACE) {
 			if (!in_escape && strchr(",.!?;:", last))
 				dt_sendchar(PROCSPEECH);
 			if (time_after_eq(jiffies, jiff_max)) {
diff --git a/drivers/staging/speakup/speakup_dectlk.c b/drivers/staging/speakup/speakup_dectlk.c
index 386ac9d87af6..0cdbd5e9b36b 100644
--- a/drivers/staging/speakup/speakup_dectlk.c
+++ b/drivers/staging/speakup/speakup_dectlk.c
@@ -260,11 +260,11 @@ static void do_catch_up(struct spk_synth *synth)
 		spin_lock_irqsave(&speakup_info.spinlock, flags);
 		synth_buffer_getc();
 		spin_unlock_irqrestore(&speakup_info.spinlock, flags);
-		if (ch == '[')
+		if (ch == '[') {
 			in_escape = 1;
-		else if (ch == ']')
+		} else if (ch == ']') {
 			in_escape = 0;
-		else if (ch <= SPACE) {
+		} else if (ch <= SPACE) {
 			if (!in_escape && strchr(",.!?;:", last))
 				synth->io_ops->synth_out(synth, PROCSPEECH);
 			if (time_after_eq(jiffies, jiff_max)) {
diff --git a/drivers/staging/speakup/varhandlers.c b/drivers/staging/speakup/varhandlers.c
index 5910fe0b1365..d37d24e26641 100644
--- a/drivers/staging/speakup/varhandlers.c
+++ b/drivers/staging/speakup/varhandlers.c
@@ -258,10 +258,11 @@ int spk_set_string_var(const char *page, struct st_var_header *var, int len)
 		if (var->p_val != var_data->u.s.default_val)
 			strcpy((char *)var->p_val, var_data->u.s.default_val);
 		return -ERESTART;
-	} else if (var->p_val)
+	} else if (var->p_val) {
 		strcpy((char *)var->p_val, page);
-	else
+	} else {
 		return -E2BIG;
+	}
 	return 0;
 }
 
@@ -281,17 +282,18 @@ int spk_set_mask_bits(const char *input, const int which, const int how)
 			spk_chartab[*cp] &= ~mask;
 	}
 	cp = (u_char *)input;
-	if (!cp)
+	if (!cp) {
 		cp = spk_punc_info[which].value;
-	else {
+	} else {
 		for (; *cp; cp++) {
 			if (*cp < SPACE)
 				break;
 			if (mask < PUNC) {
 				if (!(spk_chartab[*cp] & PUNC))
 					break;
-			} else if (spk_chartab[*cp] & B_NUM)
+			} else if (spk_chartab[*cp] & B_NUM) {
 				break;
+			}
 		}
 		if (*cp)
 			return -EINVAL;
-- 
2.11.0

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

* [PATCH 05/11] staging: speakup: Remove multiple assignments
  2017-03-21 11:42 [RESEND PATCH 00/11] staging:speakup: Multiple Checkpatch issues Arushi Singhal
                   ` (3 preceding siblings ...)
  2017-03-21 11:42 ` [PATCH 04/11] staging: speakup: fixes braces {} should be used on all arms of this statement Arushi Singhal
@ 2017-03-21 11:42 ` Arushi Singhal
  2017-03-23 13:18   ` Greg KH
  2017-03-21 11:42 ` [PATCH 06/11] staging: speakup: Moved OR operator to previous line Arushi Singhal
                   ` (6 subsequent siblings)
  11 siblings, 1 reply; 17+ messages in thread
From: Arushi Singhal @ 2017-03-21 11:42 UTC (permalink / raw)
  To: w.d.hubbs
  Cc: chris, outreachy-kernel, kirk, samuel.thibault, gregkh, speakup,
	devel, linux-kernel, Arushi Singhal

This patch fixes the checkpatch.pl warning "multiple assignments
should be avoided."

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
---
 drivers/staging/speakup/main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c
index 21e76b031449..c10445624e92 100644
--- a/drivers/staging/speakup/main.c
+++ b/drivers/staging/speakup/main.c
@@ -2106,7 +2106,8 @@ speakup_key(struct vc_data *vc, int shift_state, int keycode, u_short keysym,
 			spk_keydown = 0;
 			goto out;
 		}
-		value = spk_lastkey = pad_chars[value];
+		value = pad_chars[value];
+		spk_lastkey = value;
 		spk_keydown++;
 		spk_parked &= 0xfe;
 		goto no_map;
-- 
2.11.0

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

* [PATCH 06/11] staging: speakup: Moved OR operator to previous line.
  2017-03-21 11:42 [RESEND PATCH 00/11] staging:speakup: Multiple Checkpatch issues Arushi Singhal
                   ` (4 preceding siblings ...)
  2017-03-21 11:42 ` [PATCH 05/11] staging: speakup: Remove multiple assignments Arushi Singhal
@ 2017-03-21 11:42 ` Arushi Singhal
  2017-03-21 11:42 ` [PATCH 07/11] staging: speakup: spaces preferred around operator Arushi Singhal
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 17+ messages in thread
From: Arushi Singhal @ 2017-03-21 11:42 UTC (permalink / raw)
  To: w.d.hubbs
  Cc: chris, outreachy-kernel, kirk, samuel.thibault, gregkh, speakup,
	devel, linux-kernel, Arushi Singhal

Moved logical OR operator to previous line to fix the following
checkpatch issue:

CHECK: Logical continuations should be on the previous line.

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
---
 drivers/staging/speakup/main.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c
index c10445624e92..def1a36da9dd 100644
--- a/drivers/staging/speakup/main.c
+++ b/drivers/staging/speakup/main.c
@@ -2173,10 +2173,10 @@ speakup_key(struct vc_data *vc, int shift_state, int keycode, u_short keysym,
 	if (up_flag || spk_killed || type == KT_SHIFT)
 		goto out;
 	spk_shut_up &= 0xfe;
-	kh = (value == KVAL(K_DOWN))
-	    || (value == KVAL(K_UP))
-	    || (value == KVAL(K_LEFT))
-	    || (value == KVAL(K_RIGHT));
+	kh = (value == KVAL(K_DOWN)) ||
+	    (value == KVAL(K_UP)) ||
+	    (value == KVAL(K_LEFT)) ||
+	    (value == KVAL(K_RIGHT));
 	if ((cursor_track != read_all_mode) || !kh)
 		if (!spk_no_intr)
 			spk_do_flush();
-- 
2.11.0

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

* [PATCH 07/11] staging: speakup: spaces preferred around operator
  2017-03-21 11:42 [RESEND PATCH 00/11] staging:speakup: Multiple Checkpatch issues Arushi Singhal
                   ` (5 preceding siblings ...)
  2017-03-21 11:42 ` [PATCH 06/11] staging: speakup: Moved OR operator to previous line Arushi Singhal
@ 2017-03-21 11:42 ` Arushi Singhal
  2017-03-21 11:42 ` [PATCH 08/11] staging: speakup: Removed Unnecessary parentheses Arushi Singhal
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 17+ messages in thread
From: Arushi Singhal @ 2017-03-21 11:42 UTC (permalink / raw)
  To: w.d.hubbs
  Cc: chris, outreachy-kernel, kirk, samuel.thibault, gregkh, speakup,
	devel, linux-kernel, Arushi Singhal

Fixed the checkpatch.pl issues like:
CHECK: spaces preferred around that '&' (ctx:VxV)
CHECK: spaces preferred around that '|' (ctx:VxV)
CHECK: spaces preferred around that '-' (ctx:VxV)
CHECK: spaces preferred around that '+' (ctx:VxV)
etc.

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
---
 drivers/staging/speakup/speakup.h        | 12 ++++++------
 drivers/staging/speakup/speakup_acntpc.c |  2 +-
 drivers/staging/speakup/speakup_decpc.c  | 20 ++++++++++----------
 drivers/staging/speakup/speakup_dtlk.c   |  2 +-
 drivers/staging/speakup/speakup_keypc.c  |  6 +++---
 drivers/staging/speakup/speakup_ltlk.c   |  2 +-
 6 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/drivers/staging/speakup/speakup.h b/drivers/staging/speakup/speakup.h
index 0bc8d6afadfa..a654334c98b9 100644
--- a/drivers/staging/speakup/speakup.h
+++ b/drivers/staging/speakup/speakup.h
@@ -20,7 +20,7 @@
 #define A_CAP 0x0007
 #define B_NUM 0x0008
 #define NUM 0x0009
-#define ALPHANUM (B_ALPHA|B_NUM)
+#define ALPHANUM (B_ALPHA | B_NUM)
 #define SOME 0x0010
 #define MOST 0x0020
 #define PUNC 0x0040
@@ -30,14 +30,14 @@
 #define B_EXNUM 0x0100
 #define CH_RPT 0x0200
 #define B_CTL 0x0400
-#define A_CTL (B_CTL+SYNTH_OK)
+#define A_CTL (B_CTL + SYNTH_OK)
 #define B_SYM 0x0800
-#define B_CAPSYM (B_CAP|B_SYM)
+#define B_CAPSYM (B_CAP | B_SYM)
 
 /* FIXME: u16 */
-#define IS_WDLM(x) (spk_chartab[((u_char)x)]&B_WDLM)
-#define IS_CHAR(x, type) (spk_chartab[((u_char)x)]&type)
-#define IS_TYPE(x, type) ((spk_chartab[((u_char)x)]&type) == type)
+#define IS_WDLM(x) (spk_chartab[((u_char)x)] & B_WDLM)
+#define IS_CHAR(x, type) (spk_chartab[((u_char)x)] & type)
+#define IS_TYPE(x, type) ((spk_chartab[((u_char)x)] & type) == type)
 
 int speakup_thread(void *data);
 void spk_reset_default_chars(void);
diff --git a/drivers/staging/speakup/speakup_acntpc.c b/drivers/staging/speakup/speakup_acntpc.c
index c5beb5602c42..b4058bd82e42 100644
--- a/drivers/staging/speakup/speakup_acntpc.c
+++ b/drivers/staging/speakup/speakup_acntpc.c
@@ -282,7 +282,7 @@ static int synth_probe(struct spk_synth *synth)
 			if (port_val == 0x53fc) {
 				/* 'S' and out&input bits */
 				synth_port_control = synth_portlist[i];
-				speakup_info.port_tts = synth_port_control+1;
+				speakup_info.port_tts = synth_port_control + 1;
 				break;
 			}
 		}
diff --git a/drivers/staging/speakup/speakup_decpc.c b/drivers/staging/speakup/speakup_decpc.c
index 5e35d7e11361..5d22c3b7edd4 100644
--- a/drivers/staging/speakup/speakup_decpc.c
+++ b/drivers/staging/speakup/speakup_decpc.c
@@ -250,7 +250,7 @@ static int dt_getstatus(void)
 static void dt_sendcmd(u_int cmd)
 {
 	outb_p(cmd & 0xFF, speakup_info.port_tts);
-	outb_p((cmd >> 8) & 0xFF, speakup_info.port_tts+1);
+	outb_p((cmd >> 8) & 0xFF, speakup_info.port_tts + 1);
 }
 
 static int dt_waitbit(int bit)
@@ -286,11 +286,11 @@ static int dt_ctrl(u_int cmd)
 
 	if (!dt_waitbit(STAT_cmd_ready))
 		return -1;
-	outb_p(0, speakup_info.port_tts+2);
-	outb_p(0, speakup_info.port_tts+3);
+	outb_p(0, speakup_info.port_tts + 2);
+	outb_p(0, speakup_info.port_tts + 3);
 	dt_getstatus();
-	dt_sendcmd(CMD_control|cmd);
-	outb_p(0, speakup_info.port_tts+6);
+	dt_sendcmd(CMD_control | cmd);
+	outb_p(0, speakup_info.port_tts + 6);
 	while (dt_getstatus() & STAT_cmd_ready) {
 		udelay(20);
 		if (--timeout == 0)
@@ -318,8 +318,8 @@ udelay(50);
 			break;
 udelay(50);
 	}
-	outb_p(DMA_sync, speakup_info.port_tts+4);
-	outb_p(0, speakup_info.port_tts+4);
+	outb_p(DMA_sync, speakup_info.port_tts + 4);
+	outb_p(0, speakup_info.port_tts + 4);
 	udelay(100);
 	for (timeout = 0; timeout < 10; timeout++) {
 		if (!(dt_getstatus() & STAT_flushing))
@@ -337,8 +337,8 @@ static int dt_sendchar(char ch)
 		return -1;
 	if (!(dt_stat & STAT_rr_char))
 		return -2;
-	outb_p(DMA_single_in, speakup_info.port_tts+4);
-	outb_p(ch, speakup_info.port_tts+4);
+	outb_p(DMA_single_in, speakup_info.port_tts + 4);
+	outb_p(ch, speakup_info.port_tts + 4);
 	dma_state ^= STAT_dma_state;
 	return 0;
 }
@@ -354,7 +354,7 @@ static int testkernel(void)
 	dt_sendcmd(CMD_sync);
 	if (!dt_waitbit(STAT_cmd_ready))
 		status = -2;
-	else if (dt_stat&0x8000)
+	else if (dt_stat & 0x8000)
 		return 0;
 	else if (dt_stat == 0x0dec)
 		pr_warn("dec_pc at 0x%x, software not loaded\n",
diff --git a/drivers/staging/speakup/speakup_dtlk.c b/drivers/staging/speakup/speakup_dtlk.c
index 693fac4365c3..5973acc0a006 100644
--- a/drivers/staging/speakup/speakup_dtlk.c
+++ b/drivers/staging/speakup/speakup_dtlk.c
@@ -300,7 +300,7 @@ static struct synth_settings *synth_interrogate(struct spk_synth *synth)
 	t += 2;
 	for (i = 0; *t != '\r'; t++) {
 		status.rom_version[i] = *t;
-		if (i < sizeof(status.rom_version)-1)
+		if (i < sizeof(status.rom_version) - 1)
 			i++;
 	}
 	status.rom_version[i] = 0;
diff --git a/drivers/staging/speakup/speakup_keypc.c b/drivers/staging/speakup/speakup_keypc.c
index 6649fa4c0ad2..ba7901178e0b 100644
--- a/drivers/staging/speakup/speakup_keypc.c
+++ b/drivers/staging/speakup/speakup_keypc.c
@@ -142,9 +142,9 @@ static char *oops(void)
 	int s1, s2, s3, s4;
 
 	s1 = inb_p(synth_port);
-	s2 = inb_p(synth_port+1);
-	s3 = inb_p(synth_port+2);
-	s4 = inb_p(synth_port+3);
+	s2 = inb_p(synth_port + 1);
+	s3 = inb_p(synth_port + 2);
+	s4 = inb_p(synth_port + 3);
 	pr_warn("synth timeout %d %d %d %d\n", s1, s2, s3, s4);
 	return NULL;
 }
diff --git a/drivers/staging/speakup/speakup_ltlk.c b/drivers/staging/speakup/speakup_ltlk.c
index cb4f2958c318..11275f49bea4 100644
--- a/drivers/staging/speakup/speakup_ltlk.c
+++ b/drivers/staging/speakup/speakup_ltlk.c
@@ -145,7 +145,7 @@ static void synth_interrogate(struct spk_synth *synth)
 		if (i > 2 && buf[i] == 0x7f)
 			break;
 	}
-	t = buf+2;
+	t = buf + 2;
 	for (i = 0; *t != '\r'; t++) {
 		rom_v[i] = *t;
 		if (++i >= 19)
-- 
2.11.0

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

* [PATCH 08/11] staging: speakup: Removed Unnecessary parentheses.
  2017-03-21 11:42 [RESEND PATCH 00/11] staging:speakup: Multiple Checkpatch issues Arushi Singhal
                   ` (6 preceding siblings ...)
  2017-03-21 11:42 ` [PATCH 07/11] staging: speakup: spaces preferred around operator Arushi Singhal
@ 2017-03-21 11:42 ` Arushi Singhal
  2017-03-21 11:42 ` [PATCH 09/11] staging: speakup: Simplify the NULL comparisons Arushi Singhal
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 17+ messages in thread
From: Arushi Singhal @ 2017-03-21 11:42 UTC (permalink / raw)
  To: w.d.hubbs
  Cc: chris, outreachy-kernel, kirk, samuel.thibault, gregkh, speakup,
	devel, linux-kernel, Arushi Singhal

Unnecessary parentheses are removed to improve readability.

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
---
 drivers/staging/speakup/kobjects.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/speakup/kobjects.c b/drivers/staging/speakup/kobjects.c
index afb61e153592..ca85476e3ff7 100644
--- a/drivers/staging/speakup/kobjects.c
+++ b/drivers/staging/speakup/kobjects.c
@@ -392,7 +392,7 @@ static ssize_t synth_store(struct kobject *kobj, struct kobj_attribute *attr,
 		len--;
 	new_synth_name[len] = '\0';
 	spk_strlwr(new_synth_name);
-	if (synth && (!strcmp(new_synth_name, synth->name))) {
+	if (synth && !strcmp(new_synth_name, synth->name)) {
 		pr_warn("%s already in use\n", new_synth_name);
 	} else if (synth_init(new_synth_name) != 0) {
 		pr_warn("failed to init synth %s\n", new_synth_name);
-- 
2.11.0

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

* [PATCH 09/11] staging: speakup: Simplify the NULL comparisons
  2017-03-21 11:42 [RESEND PATCH 00/11] staging:speakup: Multiple Checkpatch issues Arushi Singhal
                   ` (7 preceding siblings ...)
  2017-03-21 11:42 ` [PATCH 08/11] staging: speakup: Removed Unnecessary parentheses Arushi Singhal
@ 2017-03-21 11:42 ` Arushi Singhal
  2017-03-23 13:19   ` Greg KH
  2017-03-21 11:42 ` [PATCH 10/11] staging: speakup: Match alignment with open parenthesis Arushi Singhal
                   ` (2 subsequent siblings)
  11 siblings, 1 reply; 17+ messages in thread
From: Arushi Singhal @ 2017-03-21 11:42 UTC (permalink / raw)
  To: w.d.hubbs
  Cc: chris, outreachy-kernel, kirk, samuel.thibault, gregkh, speakup,
	devel, linux-kernel, Arushi Singhal

Fixed coding style for null comparisons in speakup driver to be more
consistant with the rest of the kernel coding style.
Replaced 'x != NULL' with 'x' and 'x = NULL' with '!x'.

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
---
 drivers/staging/speakup/fakekey.c |  2 +-
 drivers/staging/speakup/main.c    | 32 ++++++++++++++++----------------
 2 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/speakup/fakekey.c b/drivers/staging/speakup/fakekey.c
index d76da0a1382c..294c74b47224 100644
--- a/drivers/staging/speakup/fakekey.c
+++ b/drivers/staging/speakup/fakekey.c
@@ -56,7 +56,7 @@ int speakup_add_virtual_keyboard(void)
 
 void speakup_remove_virtual_keyboard(void)
 {
-	if (virt_keyboard != NULL) {
+	if (virt_keyboard) {
 		input_unregister_device(virt_keyboard);
 		virt_keyboard = NULL;
 	}
diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c
index def1a36da9dd..7568e8149613 100644
--- a/drivers/staging/speakup/main.c
+++ b/drivers/staging/speakup/main.c
@@ -304,7 +304,7 @@ static void speakup_shut_up(struct vc_data *vc)
 	spk_shut_up |= 0x01;
 	spk_parked &= 0xfe;
 	speakup_date(vc);
-	if (synth != NULL)
+	if (synth)
 		spk_do_flush();
 }
 
@@ -449,7 +449,7 @@ static void speak_char(u16 ch)
 	}
 
 	cp = spk_characters[ch];
-	if (cp == NULL) {
+	if (!cp) {
 		pr_info("speak_char: cp == NULL!\n");
 		return;
 	}
@@ -1177,7 +1177,7 @@ static void do_handle_shift(struct vc_data *vc, u_char value, char up_flag)
 {
 	unsigned long flags;
 
-	if (synth == NULL || up_flag || spk_killed)
+	if (!synth || up_flag || spk_killed)
 		return;
 	spin_lock_irqsave(&speakup_info.spinlock, flags);
 	if (cursor_track == read_all_mode) {
@@ -1215,7 +1215,7 @@ static void do_handle_latin(struct vc_data *vc, u_char value, char up_flag)
 		spin_unlock_irqrestore(&speakup_info.spinlock, flags);
 		return;
 	}
-	if (synth == NULL || spk_killed) {
+	if (!synth || spk_killed) {
 		spin_unlock_irqrestore(&speakup_info.spinlock, flags);
 		return;
 	}
@@ -1341,7 +1341,7 @@ static int speakup_allocate(struct vc_data *vc)
 	int vc_num;
 
 	vc_num = vc->vc_num;
-	if (speakup_console[vc_num] == NULL) {
+	if (!speakup_console[vc_num]) {
 		speakup_console[vc_num] = kzalloc(sizeof(*speakup_console[0]),
 						  GFP_ATOMIC);
 		if (!speakup_console[vc_num])
@@ -1394,7 +1394,7 @@ static void kbd_fakekey2(struct vc_data *vc, int command)
 
 static void read_all_doc(struct vc_data *vc)
 {
-	if ((vc->vc_num != fg_console) || synth == NULL || spk_shut_up)
+	if ((vc->vc_num != fg_console) || !synth || spk_shut_up)
 		return;
 	if (!synth_supports_indexing())
 		return;
@@ -1509,7 +1509,7 @@ static int pre_handle_cursor(struct vc_data *vc, u_char value, char up_flag)
 	spin_lock_irqsave(&speakup_info.spinlock, flags);
 	if (cursor_track == read_all_mode) {
 		spk_parked &= 0xfe;
-		if (synth == NULL || up_flag || spk_shut_up) {
+		if (!synth || up_flag || spk_shut_up) {
 			spin_unlock_irqrestore(&speakup_info.spinlock, flags);
 			return NOTIFY_STOP;
 		}
@@ -1531,7 +1531,7 @@ static void do_handle_cursor(struct vc_data *vc, u_char value, char up_flag)
 
 	spin_lock_irqsave(&speakup_info.spinlock, flags);
 	spk_parked &= 0xfe;
-	if (synth == NULL || up_flag || spk_shut_up || cursor_track == CT_Off) {
+	if (!synth || up_flag || spk_shut_up || cursor_track == CT_Off) {
 		spin_unlock_irqrestore(&speakup_info.spinlock, flags);
 		return;
 	}
@@ -1730,7 +1730,7 @@ static void speakup_bs(struct vc_data *vc)
 		return;
 	if (!spk_parked)
 		speakup_date(vc);
-	if (spk_shut_up || synth == NULL) {
+	if (spk_shut_up || !synth) {
 		spin_unlock_irqrestore(&speakup_info.spinlock, flags);
 		return;
 	}
@@ -1747,7 +1747,7 @@ static void speakup_con_write(struct vc_data *vc, u16 *str, int len)
 {
 	unsigned long flags;
 
-	if ((vc->vc_num != fg_console) || spk_shut_up || synth == NULL)
+	if ((vc->vc_num != fg_console) || spk_shut_up || !synth)
 		return;
 	if (!spin_trylock_irqsave(&speakup_info.spinlock, flags))
 		/* Speakup output, discard */
@@ -1776,7 +1776,7 @@ static void speakup_con_update(struct vc_data *vc)
 {
 	unsigned long flags;
 
-	if (speakup_console[vc->vc_num] == NULL || spk_parked)
+	if (!speakup_console[vc->vc_num] || spk_parked)
 		return;
 	if (!spin_trylock_irqsave(&speakup_info.spinlock, flags))
 		/* Speakup output, discard */
@@ -1791,7 +1791,7 @@ static void do_handle_spec(struct vc_data *vc, u_char value, char up_flag)
 	int on_off = 2;
 	char *label;
 
-	if (synth == NULL || up_flag || spk_killed)
+	if (!synth || up_flag || spk_killed)
 		return;
 	spin_lock_irqsave(&speakup_info.spinlock, flags);
 	spk_shut_up &= 0xfe;
@@ -1835,7 +1835,7 @@ static int inc_dec_var(u_char value)
 
 	var_id = var_id / 2 + FIRST_SET_VAR;
 	p_header = spk_get_var_header(var_id);
-	if (p_header == NULL)
+	if (!p_header)
 		return -1;
 	if (p_header->var_type != VAR_NUM)
 		return -1;
@@ -1918,7 +1918,7 @@ static void speakup_bits(struct vc_data *vc)
 {
 	int val = this_speakup_key - (FIRST_EDIT_BITS - 1);
 
-	if (spk_special_handler != NULL || val < 1 || val > 6) {
+	if (spk_special_handler || val < 1 || val > 6) {
 		synth_printf("%s\n", spk_msg_get(MSG_ERROR));
 		return;
 	}
@@ -2012,7 +2012,7 @@ static int handle_goto(struct vc_data *vc, u_char type, u_char ch, u_short key)
 
 static void speakup_goto(struct vc_data *vc)
 {
-	if (spk_special_handler != NULL) {
+	if (spk_special_handler) {
 		synth_printf("%s\n", spk_msg_get(MSG_ERROR));
 		return;
 	}
@@ -2164,7 +2164,7 @@ speakup_key(struct vc_data *vc, int shift_state, int keycode, u_short keysym,
 		}
 	}
 no_map:
-	if (type == KT_SPKUP && spk_special_handler == NULL) {
+	if (type == KT_SPKUP && !spk_special_handler) {
 		do_spkup(vc, new_key);
 		spk_close_press = 0;
 		ret = 1;
-- 
2.11.0

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

* [PATCH 10/11] staging: speakup: Match alignment with open parenthesis.
  2017-03-21 11:42 [RESEND PATCH 00/11] staging:speakup: Multiple Checkpatch issues Arushi Singhal
                   ` (8 preceding siblings ...)
  2017-03-21 11:42 ` [PATCH 09/11] staging: speakup: Simplify the NULL comparisons Arushi Singhal
@ 2017-03-21 11:42 ` Arushi Singhal
  2017-03-21 11:42 ` [PATCH 11/11] staging: speakup: Fix alignment with parenthesis Arushi Singhal
       [not found] ` <6e75c652-f348-4592-a79d-4f290de9bea1@googlegroups.com>
  11 siblings, 0 replies; 17+ messages in thread
From: Arushi Singhal @ 2017-03-21 11:42 UTC (permalink / raw)
  To: w.d.hubbs
  Cc: chris, outreachy-kernel, kirk, samuel.thibault, gregkh, speakup,
	devel, linux-kernel, Arushi Singhal

Fix checkpatch issues: "CHECK: Alignment should match open parenthesis".

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
---
 drivers/staging/speakup/main.c           | 2 +-
 drivers/staging/speakup/selection.c      | 2 +-
 drivers/staging/speakup/serialio.c       | 2 +-
 drivers/staging/speakup/speakup_acntpc.c | 6 +++---
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c
index 7568e8149613..55bf7af1d6ea 100644
--- a/drivers/staging/speakup/main.c
+++ b/drivers/staging/speakup/main.c
@@ -1160,7 +1160,7 @@ static void spkup_write(const u16 *in_buf, int count)
 		if (last_type & CH_RPT) {
 			synth_printf(" ");
 			synth_printf(spk_msg_get(MSG_REPEAT_DESC2),
-					++rep_count);
+				     ++rep_count);
 			synth_printf(" ");
 		}
 		rep_count = 0;
diff --git a/drivers/staging/speakup/selection.c b/drivers/staging/speakup/selection.c
index 4417c00e68a7..08f68fc2864e 100644
--- a/drivers/staging/speakup/selection.c
+++ b/drivers/staging/speakup/selection.c
@@ -75,7 +75,7 @@ int speakup_set_selection(struct tty_struct *tty)
 		speakup_clear_selection();
 		spk_sel_cons = vc_cons[fg_console].d;
 		dev_warn(tty->dev,
-			"Selection: mark console not the same as cut\n");
+			 "Selection: mark console not the same as cut\n");
 		return -EINVAL;
 	}
 
diff --git a/drivers/staging/speakup/serialio.c b/drivers/staging/speakup/serialio.c
index e860e48818a4..5e31acac19de 100644
--- a/drivers/staging/speakup/serialio.c
+++ b/drivers/staging/speakup/serialio.c
@@ -125,7 +125,7 @@ static void start_serial_interrupt(int irq)
 		pr_err("Unable to request Speakup serial I R Q\n");
 	/* Set MCR */
 	outb(UART_MCR_DTR | UART_MCR_RTS | UART_MCR_OUT2,
-			speakup_info.port_tts + UART_MCR);
+	     speakup_info.port_tts + UART_MCR);
 	/* Turn on Interrupts */
 	outb(UART_IER_MSI|UART_IER_RLSI|UART_IER_RDI,
 			speakup_info.port_tts + UART_IER);
diff --git a/drivers/staging/speakup/speakup_acntpc.c b/drivers/staging/speakup/speakup_acntpc.c
index b4058bd82e42..ad72f8e883fc 100644
--- a/drivers/staging/speakup/speakup_acntpc.c
+++ b/drivers/staging/speakup/speakup_acntpc.c
@@ -261,9 +261,9 @@ static int synth_probe(struct spk_synth *synth)
 	if (port_forced) {
 		speakup_info.port_tts = port_forced;
 		pr_info("probe forced to %x by kernel command line\n",
-				speakup_info.port_tts);
+			speakup_info.port_tts);
 		if (synth_request_region(speakup_info.port_tts - 1,
-					SYNTH_IO_EXTENT)) {
+					 SYNTH_IO_EXTENT)) {
 			pr_warn("sorry, port already reserved\n");
 			return -EBUSY;
 		}
@@ -272,7 +272,7 @@ static int synth_probe(struct spk_synth *synth)
 	} else {
 		for (i = 0; synth_portlist[i]; i++) {
 			if (synth_request_region(synth_portlist[i],
-						SYNTH_IO_EXTENT)) {
+						 SYNTH_IO_EXTENT)) {
 				pr_warn
 				    ("request_region: failed with 0x%x, %d\n",
 				     synth_portlist[i], SYNTH_IO_EXTENT);
-- 
2.11.0

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

* [PATCH 11/11] staging: speakup: Fix alignment with parenthesis.
  2017-03-21 11:42 [RESEND PATCH 00/11] staging:speakup: Multiple Checkpatch issues Arushi Singhal
                   ` (9 preceding siblings ...)
  2017-03-21 11:42 ` [PATCH 10/11] staging: speakup: Match alignment with open parenthesis Arushi Singhal
@ 2017-03-21 11:42 ` Arushi Singhal
  2017-03-23 13:20   ` Greg KH
       [not found] ` <6e75c652-f348-4592-a79d-4f290de9bea1@googlegroups.com>
  11 siblings, 1 reply; 17+ messages in thread
From: Arushi Singhal @ 2017-03-21 11:42 UTC (permalink / raw)
  To: w.d.hubbs
  Cc: chris, outreachy-kernel, kirk, samuel.thibault, gregkh, speakup,
	devel, linux-kernel, Arushi Singhal

This patch fixes the warnings reported by checkpatch.pl
for please use a blank line after function/struct/union/enum
declarations.

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
---
 drivers/staging/speakup/speakup_apollo.c | 2 +-
 drivers/staging/speakup/speakup_decext.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/speakup/speakup_apollo.c b/drivers/staging/speakup/speakup_apollo.c
index 9cfdbbfb9742..6ad83dc642c4 100644
--- a/drivers/staging/speakup/speakup_apollo.c
+++ b/drivers/staging/speakup/speakup_apollo.c
@@ -173,7 +173,7 @@ static void do_catch_up(struct spk_synth *synth)
 		if (!synth->io_ops->synth_out(synth, ch)) {
 			outb(UART_MCR_DTR, speakup_info.port_tts + UART_MCR);
 			outb(UART_MCR_DTR | UART_MCR_RTS,
-					speakup_info.port_tts + UART_MCR);
+			     speakup_info.port_tts + UART_MCR);
 			schedule_timeout(msecs_to_jiffies(full_time_val));
 			continue;
 		}
diff --git a/drivers/staging/speakup/speakup_decext.c b/drivers/staging/speakup/speakup_decext.c
index 929a28d618dc..c564bf8e1531 100644
--- a/drivers/staging/speakup/speakup_decext.c
+++ b/drivers/staging/speakup/speakup_decext.c
@@ -206,11 +206,11 @@ static void do_catch_up(struct spk_synth *synth)
 				if (!in_escape)
 					synth->io_ops->synth_out(synth, PROCSPEECH);
 				spin_lock_irqsave(&speakup_info.spinlock,
-							flags);
+						  flags);
 				jiffy_delta_val = jiffy_delta->u.n.value;
 				delay_time_val = delay_time->u.n.value;
 				spin_unlock_irqrestore(&speakup_info.spinlock,
-							flags);
+						       flags);
 				schedule_timeout(msecs_to_jiffies
 						 (delay_time_val));
 				jiff_max = jiffies + jiffy_delta_val;
-- 
2.11.0

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

* Re: [RESEND PATCH 00/11] staging:speakup: Multiple Checkpatch issues.
       [not found] ` <6e75c652-f348-4592-a79d-4f290de9bea1@googlegroups.com>
@ 2017-03-22 20:42   ` Greg KH
  0 siblings, 0 replies; 17+ messages in thread
From: Greg KH @ 2017-03-22 20:42 UTC (permalink / raw)
  To: Arushi Singhal
  Cc: outreachy-kernel, w.d.hubbs, chris, kirk, samuel.thibault,
	speakup, devel, linux-kernel

On Wed, Mar 22, 2017 at 12:20:23PM -0700, Arushi Singhal wrote:
> On Tuesday, March 21, 2017 at 5:12:41 PM UTC+5:30, Arushi Singhal wrote:
> 
>     Improve readability by fixing multiple checkpatch.pl
>     issues in speakup driver.
> 
>     Arushi Singhal (11):
>       staging: speakup: Moved logical to previous line.
>       staging: speakup: Remove multiple assignments
>       staging: speakup: Simplify "NULL" comparisons
>       staging: speakup: fixes braces {} should be used on all arms of this
>         statement
>       staging: speakup: Remove multiple assignments
>       staging: speakup: Moved OR operator to previous line.
>       staging: speakup: spaces preferred around operator
>       staging: speakup: Removed Unnecessary parentheses.
>       staging: speakup: Simplify the NULL comparisons
>       staging: speakup: Match alignment with open parenthesis.
>       staging: speakup: Fix alignment with parenthesis.
> 
>      drivers/staging/speakup/fakekey.c        |   2 +-
>      drivers/staging/speakup/kobjects.c       |   2 +-
>      drivers/staging/speakup/main.c           | 110
>     +++++++++++++++++--------------
>      drivers/staging/speakup/selection.c      |   4 +-
>      drivers/staging/speakup/serialio.c       |   2 +-
>      drivers/staging/speakup/speakup.h        |  12 ++--
>      drivers/staging/speakup/speakup_acntpc.c |   8 +--
>      drivers/staging/speakup/speakup_apollo.c |   2 +-
>      drivers/staging/speakup/speakup_decext.c |  10 +--
>      drivers/staging/speakup/speakup_decpc.c  |  26 ++++----
>      drivers/staging/speakup/speakup_dectlk.c |   6 +-
>      drivers/staging/speakup/speakup_dtlk.c   |   2 +-
>      drivers/staging/speakup/speakup_keypc.c  |   6 +-
>      drivers/staging/speakup/speakup_ltlk.c   |   2 +-
>      drivers/staging/speakup/varhandlers.c    |  18 ++---
>      15 files changed, 114 insertions(+), 98 deletions(-)
> 
> 
> Hi
> Any update on these patches?

One day?  Please give us a chance, realize that it's normally a 2 week
timeframe to get a patch reviewed...

thanks,

greg k-h

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

* Re: [PATCH 02/11] staging: speakup: Remove multiple assignments
  2017-03-21 11:42 ` [PATCH 02/11] staging: speakup: Remove multiple assignments Arushi Singhal
@ 2017-03-23 13:18   ` Greg KH
  0 siblings, 0 replies; 17+ messages in thread
From: Greg KH @ 2017-03-23 13:18 UTC (permalink / raw)
  To: Arushi Singhal
  Cc: w.d.hubbs, devel, kirk, speakup, linux-kernel, outreachy-kernel,
	samuel.thibault, chris

On Tue, Mar 21, 2017 at 05:12:26PM +0530, Arushi Singhal wrote:
> This patch fixes the checkpatch.pl warning "multiple assignments
> should be avoided."
> 
> Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
> ---
>  drivers/staging/speakup/main.c | 18 ++++++++++++------
>  1 file changed, 12 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c
> index f71206878363..f8fccc8bf6b2 100644
> --- a/drivers/staging/speakup/main.c
> +++ b/drivers/staging/speakup/main.c
> @@ -270,9 +270,12 @@ static unsigned char get_attributes(struct vc_data *vc, u16 *pos)
>  
>  static void speakup_date(struct vc_data *vc)
>  {
> -	spk_x = spk_cx = vc->vc_x;
> -	spk_y = spk_cy = vc->vc_y;
> -	spk_pos = spk_cp = vc->vc_pos;
> +	spk_x = vc->vc_x;
> +	spk_cx = spk_x;
> +	spk_y = vc->vc_y;
> +	spk_cy = spk_y;
> +	spk_pos = vc->vc_pos;
> +	spk_cp = spk_pos;

Ick, this is harder to read now, don't you think?

not good.

greg k-h

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

* Re: [PATCH 05/11] staging: speakup: Remove multiple assignments
  2017-03-21 11:42 ` [PATCH 05/11] staging: speakup: Remove multiple assignments Arushi Singhal
@ 2017-03-23 13:18   ` Greg KH
  0 siblings, 0 replies; 17+ messages in thread
From: Greg KH @ 2017-03-23 13:18 UTC (permalink / raw)
  To: Arushi Singhal
  Cc: w.d.hubbs, devel, kirk, speakup, linux-kernel, outreachy-kernel,
	samuel.thibault, chris

On Tue, Mar 21, 2017 at 05:12:29PM +0530, Arushi Singhal wrote:
> This patch fixes the checkpatch.pl warning "multiple assignments
> should be avoided."
> 
> Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
> ---
>  drivers/staging/speakup/main.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c
> index 21e76b031449..c10445624e92 100644
> --- a/drivers/staging/speakup/main.c
> +++ b/drivers/staging/speakup/main.c
> @@ -2106,7 +2106,8 @@ speakup_key(struct vc_data *vc, int shift_state, int keycode, u_short keysym,
>  			spk_keydown = 0;
>  			goto out;
>  		}
> -		value = spk_lastkey = pad_chars[value];
> +		value = pad_chars[value];
> +		spk_lastkey = value;

Also harder to read now :(

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

* Re: [PATCH 09/11] staging: speakup: Simplify the NULL comparisons
  2017-03-21 11:42 ` [PATCH 09/11] staging: speakup: Simplify the NULL comparisons Arushi Singhal
@ 2017-03-23 13:19   ` Greg KH
  0 siblings, 0 replies; 17+ messages in thread
From: Greg KH @ 2017-03-23 13:19 UTC (permalink / raw)
  To: Arushi Singhal
  Cc: w.d.hubbs, devel, kirk, speakup, linux-kernel, outreachy-kernel,
	samuel.thibault, chris

On Tue, Mar 21, 2017 at 05:12:33PM +0530, Arushi Singhal wrote:
> Fixed coding style for null comparisons in speakup driver to be more
> consistant with the rest of the kernel coding style.
> Replaced 'x != NULL' with 'x' and 'x = NULL' with '!x'.
> 
> Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
> ---
>  drivers/staging/speakup/fakekey.c |  2 +-
>  drivers/staging/speakup/main.c    | 32 ++++++++++++++++----------------
>  2 files changed, 17 insertions(+), 17 deletions(-)

You used this same subject line in this series, not good :(

greg k-h

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

* Re: [PATCH 11/11] staging: speakup: Fix alignment with parenthesis.
  2017-03-21 11:42 ` [PATCH 11/11] staging: speakup: Fix alignment with parenthesis Arushi Singhal
@ 2017-03-23 13:20   ` Greg KH
  0 siblings, 0 replies; 17+ messages in thread
From: Greg KH @ 2017-03-23 13:20 UTC (permalink / raw)
  To: Arushi Singhal
  Cc: w.d.hubbs, devel, kirk, speakup, linux-kernel, outreachy-kernel,
	samuel.thibault, chris

On Tue, Mar 21, 2017 at 05:12:35PM +0530, Arushi Singhal wrote:
> This patch fixes the warnings reported by checkpatch.pl
> for please use a blank line after function/struct/union/enum
> declarations.

That's not what this patch does at all!

Please be more careful.

greg k-h

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

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

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-21 11:42 [RESEND PATCH 00/11] staging:speakup: Multiple Checkpatch issues Arushi Singhal
2017-03-21 11:42 ` [PATCH 01/11] staging: speakup: Moved logical to previous line Arushi Singhal
2017-03-21 11:42 ` [PATCH 02/11] staging: speakup: Remove multiple assignments Arushi Singhal
2017-03-23 13:18   ` Greg KH
2017-03-21 11:42 ` [PATCH 03/11] staging: speakup: Simplify "NULL" comparisons Arushi Singhal
2017-03-21 11:42 ` [PATCH 04/11] staging: speakup: fixes braces {} should be used on all arms of this statement Arushi Singhal
2017-03-21 11:42 ` [PATCH 05/11] staging: speakup: Remove multiple assignments Arushi Singhal
2017-03-23 13:18   ` Greg KH
2017-03-21 11:42 ` [PATCH 06/11] staging: speakup: Moved OR operator to previous line Arushi Singhal
2017-03-21 11:42 ` [PATCH 07/11] staging: speakup: spaces preferred around operator Arushi Singhal
2017-03-21 11:42 ` [PATCH 08/11] staging: speakup: Removed Unnecessary parentheses Arushi Singhal
2017-03-21 11:42 ` [PATCH 09/11] staging: speakup: Simplify the NULL comparisons Arushi Singhal
2017-03-23 13:19   ` Greg KH
2017-03-21 11:42 ` [PATCH 10/11] staging: speakup: Match alignment with open parenthesis Arushi Singhal
2017-03-21 11:42 ` [PATCH 11/11] staging: speakup: Fix alignment with parenthesis Arushi Singhal
2017-03-23 13:20   ` Greg KH
     [not found] ` <6e75c652-f348-4592-a79d-4f290de9bea1@googlegroups.com>
2017-03-22 20:42   ` [RESEND PATCH 00/11] staging:speakup: Multiple Checkpatch issues Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).