Commit 65b77ccb authored by Sven Schnelle's avatar Sven Schnelle Committed by Heiko Carstens

s390/tty3270: use switch/case in tty3270_erase_display()

This makes the code easier to read.
Signed-off-by: default avatarSven Schnelle <svens@linux.ibm.com>
Acked-by: default avatarHeiko Carstens <hca@linux.ibm.com>
Tested-by: default avatarNiklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
parent 815f3eee
...@@ -1337,25 +1337,29 @@ static void tty3270_erase_line(struct tty3270 *tp, int mode) ...@@ -1337,25 +1337,29 @@ static void tty3270_erase_line(struct tty3270 *tp, int mode)
*/ */
static void tty3270_erase_display(struct tty3270 *tp, int mode) static void tty3270_erase_display(struct tty3270 *tp, int mode)
{ {
int i; int i, start, end;
if (mode == 0) { switch (mode) {
case 0:
tty3270_erase_line(tp, 0); tty3270_erase_line(tp, 0);
for (i = tp->cy + 1; i < tp->view.rows - 2; i++) { start = tp->cy + 1;
tp->screen[i].len = 0; end = tp->view.rows - 2;
tty3270_convert_line(tp, i); break;
} case 1:
} else if (mode == 1) { start = 0;
for (i = 0; i < tp->cy; i++) { end = tp->cy;
tp->screen[i].len = 0;
tty3270_convert_line(tp, i);
}
tty3270_erase_line(tp, 1); tty3270_erase_line(tp, 1);
} else if (mode == 2) { break;
for (i = 0; i < tp->view.rows - 2; i++) { case 2:
tp->screen[i].len = 0; start = 0;
tty3270_convert_line(tp, i); end = tp->view.rows - 2;
} break;
default:
return;
}
for (i = start; i < end; i++) {
tp->screen[i].len = 0;
tty3270_convert_line(tp, i);
} }
tty3270_rebuild_update(tp); tty3270_rebuild_update(tp);
} }
......
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