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)
*/
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);
for (i = tp->cy + 1; i < tp->view.rows - 2; i++) {
tp->screen[i].len = 0;
tty3270_convert_line(tp, i);
}
} else if (mode == 1) {
for (i = 0; i < tp->cy; i++) {
tp->screen[i].len = 0;
tty3270_convert_line(tp, i);
}
start = tp->cy + 1;
end = tp->view.rows - 2;
break;
case 1:
start = 0;
end = tp->cy;
tty3270_erase_line(tp, 1);
} else if (mode == 2) {
for (i = 0; i < tp->view.rows - 2; i++) {
tp->screen[i].len = 0;
tty3270_convert_line(tp, i);
}
break;
case 2:
start = 0;
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);
}
......
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