Commit 0d1ffef5 authored by Jiri Slaby's avatar Jiri Slaby Committed by Greg Kroah-Hartman

vt: move rescan_last_byte label earlier

This removes duplicated initialization of variables (after reordering
'c' initialization).

It will also allow for eliminating whole translation into a separate
function in the next patch.

Note that vc_state, vc_utf etc. are checked with every rescan now. But
they are immutable for non-control characters where rescan might be
only necessary.
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20200615074910.19267-15-jslaby@suse.czSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 881c8783
...@@ -2717,10 +2717,11 @@ static int do_con_write(struct tty_struct *tty, const unsigned char *buf, int co ...@@ -2717,10 +2717,11 @@ static int do_con_write(struct tty_struct *tty, const unsigned char *buf, int co
while (!tty->stopped && count) { while (!tty->stopped && count) {
int orig = *buf; int orig = *buf;
c = orig;
buf++; buf++;
n++; n++;
count--; count--;
rescan_last_byte:
c = orig;
rescan = false; rescan = false;
inverse = false; inverse = false;
width = 1; width = 1;
...@@ -2729,7 +2730,6 @@ static int do_con_write(struct tty_struct *tty, const unsigned char *buf, int co ...@@ -2729,7 +2730,6 @@ static int do_con_write(struct tty_struct *tty, const unsigned char *buf, int co
if (vc->vc_state != ESnormal) { if (vc->vc_state != ESnormal) {
tc = c; tc = c;
} else if (vc->vc_utf && !vc->vc_disp_ctrl) { } else if (vc->vc_utf && !vc->vc_disp_ctrl) {
rescan_last_byte:
tc = c = vc_translate_unicode(vc, c, &rescan); tc = c = vc_translate_unicode(vc, c, &rescan);
if (tc == -1) if (tc == -1)
continue; continue;
...@@ -2834,13 +2834,9 @@ static int do_con_write(struct tty_struct *tty, const unsigned char *buf, int co ...@@ -2834,13 +2834,9 @@ static int do_con_write(struct tty_struct *tty, const unsigned char *buf, int co
if (inverse) if (inverse)
con_flush(vc, draw_from, draw_to, &draw_x); con_flush(vc, draw_from, draw_to, &draw_x);
if (rescan) { if (rescan)
rescan = false;
inverse = false;
width = 1;
c = orig;
goto rescan_last_byte; goto rescan_last_byte;
}
continue; continue;
} }
con_flush(vc, draw_from, draw_to, &draw_x); con_flush(vc, draw_from, draw_to, &draw_x);
......
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