Commit 815f3eee authored by Sven Schnelle's avatar Sven Schnelle Committed by Heiko Carstens

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

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 13d4999a
...@@ -1306,9 +1306,11 @@ static void tty3270_erase_line(struct tty3270 *tp, int mode) ...@@ -1306,9 +1306,11 @@ static void tty3270_erase_line(struct tty3270 *tp, int mode)
int i; int i;
line = tp->screen + tp->cy; line = tp->screen + tp->cy;
if (mode == 0) switch (mode) {
case 0:
line->len = tp->cx; line->len = tp->cx;
else if (mode == 1) { break;
case 1:
for (i = 0; i < tp->cx; i++) { for (i = 0; i < tp->cx; i++) {
cell = line->cells + i; cell = line->cells + i;
cell->character = ' '; cell->character = ' ';
...@@ -1317,8 +1319,13 @@ static void tty3270_erase_line(struct tty3270 *tp, int mode) ...@@ -1317,8 +1319,13 @@ static void tty3270_erase_line(struct tty3270 *tp, int mode)
} }
if (line->len <= tp->cx) if (line->len <= tp->cx)
line->len = tp->cx + 1; line->len = tp->cx + 1;
} else if (mode == 2) break;
case 2:
line->len = 0; line->len = 0;
break;
default:
return;
}
tty3270_convert_line(tp, tp->cy); tty3270_convert_line(tp, tp->cy);
} }
......
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