lkml.org 
[lkml]   [2013]   [Jun]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 05/20] n_tty: Simplify __receive_buf loop count
Date
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
---
drivers/tty/n_tty.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c
index caf37d3..f959dc9 100644
--- a/drivers/tty/n_tty.c
+++ b/drivers/tty/n_tty.c
@@ -1504,21 +1504,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);
--
1.8.1.2


\
 
 \ /
  Last update: 2013-06-15 16:41    [W:0.208 / U:1.852 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site