From: Peter Hurley Date: Sat, 15 Jun 2013 14:21:21 +0000 (-0400) Subject: n_tty: Simplify __receive_buf loop count X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=781ad1c79379c723138945b633121a78e9e5485f;p=openwrt%2Fstaging%2Fblogic.git n_tty: Simplify __receive_buf loop count Signed-off-by: Peter Hurley Signed-off-by: Greg Kroah-Hartman --- 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, 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);