Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 781ad1c7 authored by Peter Hurley's avatar Peter Hurley Committed by Greg Kroah-Hartman
Browse files

n_tty: Simplify __receive_buf loop count

parent 1bb9d562
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -1505,21 +1505,19 @@ static void __receive_buf(struct tty_struct *tty, const unsigned char *cp,
		memcpy(read_buf_addr(ldata, head), cp, n);
		ldata->read_head += n;
	} else {
		int i;

		for (i = count; i; i--, cp++) {
		while (count--) {
			if (fp)
				flags = *fp++;
			switch (flags) {
			case TTY_NORMAL:
				n_tty_receive_char(tty, *cp);
				n_tty_receive_char(tty, *cp++);
				break;
			case TTY_BREAK:
				n_tty_receive_break(tty);
				break;
			case TTY_PARITY:
			case TTY_FRAME:
				n_tty_receive_parity_error(tty, *cp);
				n_tty_receive_parity_error(tty, *cp++);
				break;
			case TTY_OVERRUN:
				n_tty_receive_overrun(tty);