Commit b985e9e3 authored by Peter Hurley's avatar Peter Hurley Committed by Greg Kroah-Hartman

n_tty: Reduce branching in canon_copy_from_read_buf()

Instead of compare-and-set, just compute 'found'.
Signed-off-by: default avatarPeter Hurley <peter@hurleysoftware.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e661cf70
...@@ -2080,10 +2080,9 @@ static int canon_copy_from_read_buf(struct tty_struct *tty, ...@@ -2080,10 +2080,9 @@ static int canon_copy_from_read_buf(struct tty_struct *tty,
if (eol == N_TTY_BUF_SIZE && more) { if (eol == N_TTY_BUF_SIZE && more) {
/* scan wrapped without finding set bit */ /* scan wrapped without finding set bit */
eol = find_next_bit(ldata->read_flags, more, 0); eol = find_next_bit(ldata->read_flags, more, 0);
if (eol != more) found = eol != more;
found = 1; } else
} else if (eol != size) found = eol != size;
found = 1;
n = eol - tail; n = eol - tail;
if (n > N_TTY_BUF_SIZE) if (n > N_TTY_BUF_SIZE)
......
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