mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-06 00:39:48 +00:00
n_tty: Simplify __receive_buf loop count
Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
1bb9d56285
commit
781ad1c793
1 changed files with 3 additions and 5 deletions
|
@ -1505,21 +1505,19 @@ static void __receive_buf(struct tty_struct *tty, const unsigned char *cp,
|
||||||
memcpy(read_buf_addr(ldata, head), cp, n);
|
memcpy(read_buf_addr(ldata, head), cp, n);
|
||||||
ldata->read_head += n;
|
ldata->read_head += n;
|
||||||
} else {
|
} else {
|
||||||
int i;
|
while (count--) {
|
||||||
|
|
||||||
for (i = count; i; i--, cp++) {
|
|
||||||
if (fp)
|
if (fp)
|
||||||
flags = *fp++;
|
flags = *fp++;
|
||||||
switch (flags) {
|
switch (flags) {
|
||||||
case TTY_NORMAL:
|
case TTY_NORMAL:
|
||||||
n_tty_receive_char(tty, *cp);
|
n_tty_receive_char(tty, *cp++);
|
||||||
break;
|
break;
|
||||||
case TTY_BREAK:
|
case TTY_BREAK:
|
||||||
n_tty_receive_break(tty);
|
n_tty_receive_break(tty);
|
||||||
break;
|
break;
|
||||||
case TTY_PARITY:
|
case TTY_PARITY:
|
||||||
case TTY_FRAME:
|
case TTY_FRAME:
|
||||||
n_tty_receive_parity_error(tty, *cp);
|
n_tty_receive_parity_error(tty, *cp++);
|
||||||
break;
|
break;
|
||||||
case TTY_OVERRUN:
|
case TTY_OVERRUN:
|
||||||
n_tty_receive_overrun(tty);
|
n_tty_receive_overrun(tty);
|
||||||
|
|
Loading…
Reference in a new issue