Commit 3a7d530a authored by Jiri Slaby's avatar Jiri Slaby Committed by Greg Kroah-Hartman

n_tty: do only one cp dereference in n_tty_receive_buf_standard

It might be confusing for readers: there are three distinct dereferences
and increments of 'cp' in n_tty_receive_buf_standard. Do it on a single
place, along with/before the 'fp' dereference.
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20210505091928.22010-9-jslaby@suse.czSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 16765365
...@@ -1531,17 +1531,17 @@ static void n_tty_receive_buf_standard(struct tty_struct *tty, ...@@ -1531,17 +1531,17 @@ static void n_tty_receive_buf_standard(struct tty_struct *tty,
char flag = TTY_NORMAL; char flag = TTY_NORMAL;
while (count--) { while (count--) {
unsigned char c = *cp++;
if (fp) if (fp)
flag = *fp++; flag = *fp++;
if (ldata->lnext) { if (ldata->lnext) {
n_tty_receive_char_lnext(tty, *cp++, flag); n_tty_receive_char_lnext(tty, c, flag);
continue; continue;
} }
if (likely(flag == TTY_NORMAL)) { if (likely(flag == TTY_NORMAL)) {
unsigned char c = *cp++;
if (I_ISTRIP(tty)) if (I_ISTRIP(tty))
c &= 0x7f; c &= 0x7f;
if (I_IUCLC(tty) && L_IEXTEN(tty)) if (I_IUCLC(tty) && L_IEXTEN(tty))
...@@ -1555,7 +1555,7 @@ static void n_tty_receive_buf_standard(struct tty_struct *tty, ...@@ -1555,7 +1555,7 @@ static void n_tty_receive_buf_standard(struct tty_struct *tty,
else else
n_tty_receive_char_special(tty, c); n_tty_receive_char_special(tty, c);
} else } else
n_tty_receive_char_flagged(tty, *cp++, flag); n_tty_receive_char_flagged(tty, c, flag);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment