All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: speakup: Remove multiple assignments
@ 2017-03-19  4:43 Arushi Singhal
  0 siblings, 0 replies; 4+ messages in thread
From: Arushi Singhal @ 2017-03-19  4:43 UTC (permalink / raw)
  To: w.d.hubbs
  Cc: Chris Brannon, Kirk Reiser, Samuel Thibault, Greg Kroah-Hartman,
	speakup, devel, linux-kernel, outreachy-kernel

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] 4+ messages in thread

* [PATCH] staging: speakup: Remove multiple assignments
@ 2016-03-05 20:58 Bhaktipriya Shridhar
  0 siblings, 0 replies; 4+ messages in thread
From: Bhaktipriya Shridhar @ 2016-03-05 20:58 UTC (permalink / raw)
  To: outreachy-kernel

This patch removes multiple assignments by factorizing them.

This was done with Coccinelle.

@ identifier i1,i2; constant c; @@
- i1=i2=c;
+ i1=c;
+ i2=c;

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
---
 drivers/staging/speakup/main.c | 30 ++++++++++++++++++++----------
 1 file changed, 20 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c
index eb8d65a..201a968 100644
--- a/drivers/staging/speakup/main.c
+++ b/drivers/staging/speakup/main.c
@@ -1188,7 +1188,8 @@ static void do_handle_latin(struct vc_data *vc, u_char value, char up_flag)

 	spin_lock_irqsave(&speakup_info.spinlock, flags);
 	if (up_flag) {
-		spk_lastkey = spk_keydown = 0;
+		spk_lastkey = 0;
+		spk_keydown = 0;
 		spin_unlock_irqrestore(&speakup_info.spinlock, flags);
 		return;
 	}
@@ -1662,7 +1663,8 @@ static void cursor_done(u_long data)
 	if (win_enabled) {
 		if (vc->vc_x >= win_left && vc->vc_x <= win_right &&
 		    vc->vc_y >= win_top && vc->vc_y <= win_bottom) {
-			spk_keydown = is_cursor = 0;
+			spk_keydown = 0;
+			is_cursor = 0;
 			goto out;
 		}
 	}
@@ -1672,7 +1674,8 @@ static void cursor_done(u_long data)
 	}
 	if (cursor_track == CT_Highlight) {
 		if (speak_highlight(vc)) {
-			spk_keydown = is_cursor = 0;
+			spk_keydown = 0;
+			is_cursor = 0;
 			goto out;
 		}
 	}
@@ -1682,7 +1685,8 @@ static void cursor_done(u_long data)
 		say_line_from_to(vc, 0, vc->vc_cols, 0);
 	else
 		say_char(vc);
-	spk_keydown = is_cursor = 0;
+	spk_keydown = 0;
+	is_cursor = 0;
 out:
 	spin_unlock_irqrestore(&speakup_info.spinlock, flags);
 }
@@ -1862,8 +1866,10 @@ static void speakup_win_set(struct vc_data *vc)

 static void speakup_win_clear(struct vc_data *vc)
 {
-	win_top = win_bottom = 0;
-	win_left = win_right = 0;
+	win_top = 0;
+	win_bottom = 0;
+	win_left = 0;
+	win_right = 0;
 	win_start = 0;
 	synth_printf("%s\n", spk_msg_get(MSG_WINDOW_CLEARED));
 }
@@ -1998,10 +2004,14 @@ static u_char key_speakup, spk_key_locked;

 static void speakup_lock(struct vc_data *vc)
 {
-	if (!spk_key_locked)
-		spk_key_locked = key_speakup = 16;
-	else
-		spk_key_locked = key_speakup = 0;
+	if (!spk_key_locked) {
+		spk_key_locked = 16;
+		key_speakup = 16;
+	}
+	else {
+		spk_key_locked = 0;
+		key_speakup = 0;
+	}
 }

 typedef void (*spkup_hand) (struct vc_data *);
--
2.1.4



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

* [PATCH] staging: speakup: remove multiple assignments
@ 2016-02-24  5:38 Alison Schofield
  0 siblings, 0 replies; 4+ messages in thread
From: Alison Schofield @ 2016-02-24  5:38 UTC (permalink / raw)
  To: outreachy-kernel

Remove multiple assignments by factorizing.

Coccinelle semantic patch used:
@@ identifier x,y; constant z; @@
- x=y=z;
+ x=z;
+ y=z;

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
---
 drivers/staging/speakup/main.c | 29 +++++++++++++++++++----------
 1 file changed, 19 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c
index eb8d65a..a87224c 100644
--- a/drivers/staging/speakup/main.c
+++ b/drivers/staging/speakup/main.c
@@ -1188,7 +1188,8 @@ static void do_handle_latin(struct vc_data *vc, u_char value, char up_flag)
 
 	spin_lock_irqsave(&speakup_info.spinlock, flags);
 	if (up_flag) {
-		spk_lastkey = spk_keydown = 0;
+		spk_lastkey = 0;
+		spk_keydown = 0;
 		spin_unlock_irqrestore(&speakup_info.spinlock, flags);
 		return;
 	}
@@ -1662,7 +1663,8 @@ static void cursor_done(u_long data)
 	if (win_enabled) {
 		if (vc->vc_x >= win_left && vc->vc_x <= win_right &&
 		    vc->vc_y >= win_top && vc->vc_y <= win_bottom) {
-			spk_keydown = is_cursor = 0;
+			spk_keydown = 0;
+			is_cursor = 0;
 			goto out;
 		}
 	}
@@ -1672,7 +1674,8 @@ static void cursor_done(u_long data)
 	}
 	if (cursor_track == CT_Highlight) {
 		if (speak_highlight(vc)) {
-			spk_keydown = is_cursor = 0;
+			spk_keydown = 0;
+			is_cursor = 0;
 			goto out;
 		}
 	}
@@ -1682,7 +1685,8 @@ static void cursor_done(u_long data)
 		say_line_from_to(vc, 0, vc->vc_cols, 0);
 	else
 		say_char(vc);
-	spk_keydown = is_cursor = 0;
+	spk_keydown = 0;
+	is_cursor = 0;
 out:
 	spin_unlock_irqrestore(&speakup_info.spinlock, flags);
 }
@@ -1862,8 +1866,10 @@ static void speakup_win_set(struct vc_data *vc)
 
 static void speakup_win_clear(struct vc_data *vc)
 {
-	win_top = win_bottom = 0;
-	win_left = win_right = 0;
+	win_top = 0;
+	win_bottom = 0;
+	win_left = 0;
+	win_right = 0;
 	win_start = 0;
 	synth_printf("%s\n", spk_msg_get(MSG_WINDOW_CLEARED));
 }
@@ -1998,10 +2004,13 @@ static u_char key_speakup, spk_key_locked;
 
 static void speakup_lock(struct vc_data *vc)
 {
-	if (!spk_key_locked)
-		spk_key_locked = key_speakup = 16;
-	else
-		spk_key_locked = key_speakup = 0;
+	if (!spk_key_locked) {
+		spk_key_locked = 16;
+		key_speakup = 16;
+	} else {
+		spk_key_locked = 0;
+		key_speakup = 0;
+	}
 }
 
 typedef void (*spkup_hand) (struct vc_data *);
-- 
2.1.4



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

* [PATCH] staging: speakup: Remove multiple assignments
@ 2015-10-23 19:12 Burcin Akalin
  0 siblings, 0 replies; 4+ messages in thread
From: Burcin Akalin @ 2015-10-23 19:12 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: Burcin Akalin

Remove multiple assignments by factorizing them.Problem found using
checkpatch.pl
CHECK: multiple assignments should be avoided

Signed-off-by: Burcin Akalin <brcnakalin@gmail.com>
---
 drivers/staging/speakup/buffers.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/speakup/buffers.c b/drivers/staging/speakup/buffers.c
index d4d4598..8565c23 100644
--- a/drivers/staging/speakup/buffers.c
+++ b/drivers/staging/speakup/buffers.c
@@ -101,6 +101,7 @@ EXPORT_SYMBOL_GPL(synth_buffer_peek);
 
 void synth_buffer_clear(void)
 {
-	buff_in = buff_out = synth_buffer;
+	buff_in = synth_buffer;
+	buff_out = synth_buffer;
 }
 EXPORT_SYMBOL_GPL(synth_buffer_clear);
-- 
1.9.1



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

end of thread, other threads:[~2017-03-19  4:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-19  4:43 [PATCH] staging: speakup: Remove multiple assignments Arushi Singhal
  -- strict thread matches above, loose matches on Subject: below --
2016-03-05 20:58 Bhaktipriya Shridhar
2016-02-24  5:38 [PATCH] staging: speakup: remove " Alison Schofield
2015-10-23 19:12 [PATCH] staging: speakup: Remove " Burcin Akalin

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.