Commit cd95ed98 authored by Alison Schofield's avatar Alison Schofield Committed by Greg Kroah-Hartman

staging: speakup: remove multiple assignments

Remove multiple assignments by factorizing.

Coccinelle semantic patch used:
@@ identifier x,y; constant z; @@
- x=y=z;
+ x=z;
+ y=z;
Signed-off-by: default avatarAlison Schofield <amsfield22@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e81e31fb
...@@ -1188,7 +1188,8 @@ static void do_handle_latin(struct vc_data *vc, u_char value, char up_flag) ...@@ -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); spin_lock_irqsave(&speakup_info.spinlock, flags);
if (up_flag) { if (up_flag) {
spk_lastkey = spk_keydown = 0; spk_lastkey = 0;
spk_keydown = 0;
spin_unlock_irqrestore(&speakup_info.spinlock, flags); spin_unlock_irqrestore(&speakup_info.spinlock, flags);
return; return;
} }
...@@ -1662,7 +1663,8 @@ static void cursor_done(u_long data) ...@@ -1662,7 +1663,8 @@ static void cursor_done(u_long data)
if (win_enabled) { if (win_enabled) {
if (vc->vc_x >= win_left && vc->vc_x <= win_right && if (vc->vc_x >= win_left && vc->vc_x <= win_right &&
vc->vc_y >= win_top && vc->vc_y <= win_bottom) { vc->vc_y >= win_top && vc->vc_y <= win_bottom) {
spk_keydown = is_cursor = 0; spk_keydown = 0;
is_cursor = 0;
goto out; goto out;
} }
} }
...@@ -1672,7 +1674,8 @@ static void cursor_done(u_long data) ...@@ -1672,7 +1674,8 @@ static void cursor_done(u_long data)
} }
if (cursor_track == CT_Highlight) { if (cursor_track == CT_Highlight) {
if (speak_highlight(vc)) { if (speak_highlight(vc)) {
spk_keydown = is_cursor = 0; spk_keydown = 0;
is_cursor = 0;
goto out; goto out;
} }
} }
...@@ -1682,7 +1685,8 @@ static void cursor_done(u_long data) ...@@ -1682,7 +1685,8 @@ static void cursor_done(u_long data)
say_line_from_to(vc, 0, vc->vc_cols, 0); say_line_from_to(vc, 0, vc->vc_cols, 0);
else else
say_char(vc); say_char(vc);
spk_keydown = is_cursor = 0; spk_keydown = 0;
is_cursor = 0;
out: out:
spin_unlock_irqrestore(&speakup_info.spinlock, flags); spin_unlock_irqrestore(&speakup_info.spinlock, flags);
} }
...@@ -1862,8 +1866,10 @@ static void speakup_win_set(struct vc_data *vc) ...@@ -1862,8 +1866,10 @@ static void speakup_win_set(struct vc_data *vc)
static void speakup_win_clear(struct vc_data *vc) static void speakup_win_clear(struct vc_data *vc)
{ {
win_top = win_bottom = 0; win_top = 0;
win_left = win_right = 0; win_bottom = 0;
win_left = 0;
win_right = 0;
win_start = 0; win_start = 0;
synth_printf("%s\n", spk_msg_get(MSG_WINDOW_CLEARED)); synth_printf("%s\n", spk_msg_get(MSG_WINDOW_CLEARED));
} }
...@@ -1998,10 +2004,13 @@ static u_char key_speakup, spk_key_locked; ...@@ -1998,10 +2004,13 @@ static u_char key_speakup, spk_key_locked;
static void speakup_lock(struct vc_data *vc) static void speakup_lock(struct vc_data *vc)
{ {
if (!spk_key_locked) if (!spk_key_locked) {
spk_key_locked = key_speakup = 16; spk_key_locked = 16;
else key_speakup = 16;
spk_key_locked = key_speakup = 0; } else {
spk_key_locked = 0;
key_speakup = 0;
}
} }
typedef void (*spkup_hand) (struct vc_data *); typedef void (*spkup_hand) (struct vc_data *);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment