summaryrefslogtreecommitdiffstats
path: root/drivers/tty/n_tty.c
diff options
context:
space:
mode:
authorPeter Hurley <peter@hurleysoftware.com>2013-06-15 10:21:21 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-07-23 17:08:40 -0700
commit781ad1c79379c723138945b633121a78e9e5485f (patch)
treeb94e00f68364ba816947ea2a4b418f9f7657a9ae /drivers/tty/n_tty.c
parent1bb9d562856279a217a4e581a803dee9bb48a708 (diff)
downloadop-kernel-dev-781ad1c79379c723138945b633121a78e9e5485f.zip
op-kernel-dev-781ad1c79379c723138945b633121a78e9e5485f.tar.gz
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.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c
index d598436..4f20bec 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);
OpenPOWER on IntegriCloud