diff options
author | Peter Hurley <peter@hurleysoftware.com> | 2013-06-15 10:21:21 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-07-23 20:08:40 -0400 |
commit | 781ad1c79379c723138945b633121a78e9e5485f (patch) | |
tree | b94e00f68364ba816947ea2a4b418f9f7657a9ae /drivers/tty/n_tty.c | |
parent | 1bb9d562856279a217a4e581a803dee9bb48a708 (diff) |
n_tty: Simplify __receive_buf loop count
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/n_tty.c')
-rw-r--r-- | drivers/tty/n_tty.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c index d598436d9bc6..4f20bec011fb 100644 --- a/drivers/tty/n_tty.c +++ b/drivers/tty/n_tty.c | |||
@@ -1505,21 +1505,19 @@ static void __receive_buf(struct tty_struct *tty, const unsigned char *cp, | |||
1505 | memcpy(read_buf_addr(ldata, head), cp, n); | 1505 | memcpy(read_buf_addr(ldata, head), cp, n); |
1506 | ldata->read_head += n; | 1506 | ldata->read_head += n; |
1507 | } else { | 1507 | } else { |
1508 | int i; | 1508 | while (count--) { |
1509 | |||
1510 | for (i = count; i; i--, cp++) { | ||
1511 | if (fp) | 1509 | if (fp) |
1512 | flags = *fp++; | 1510 | flags = *fp++; |
1513 | switch (flags) { | 1511 | switch (flags) { |
1514 | case TTY_NORMAL: | 1512 | case TTY_NORMAL: |
1515 | n_tty_receive_char(tty, *cp); | 1513 | n_tty_receive_char(tty, *cp++); |
1516 | break; | 1514 | break; |
1517 | case TTY_BREAK: | 1515 | case TTY_BREAK: |
1518 | n_tty_receive_break(tty); | 1516 | n_tty_receive_break(tty); |
1519 | break; | 1517 | break; |
1520 | case TTY_PARITY: | 1518 | case TTY_PARITY: |
1521 | case TTY_FRAME: | 1519 | case TTY_FRAME: |
1522 | n_tty_receive_parity_error(tty, *cp); | 1520 | n_tty_receive_parity_error(tty, *cp++); |
1523 | break; | 1521 | break; |
1524 | case TTY_OVERRUN: | 1522 | case TTY_OVERRUN: |
1525 | n_tty_receive_overrun(tty); | 1523 | n_tty_receive_overrun(tty); |