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

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
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -1306,9 +1306,11 @@ static void tty3270_erase_line(struct tty3270 *tp, int mode)
	int i;

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