mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 17:30:53 +07:00
n_tty: Reduce branching in canon_copy_from_read_buf()
Instead of compare-and-set, just compute 'found'. Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
e661cf7020
commit
b985e9e368
@ -2080,10 +2080,9 @@ static int canon_copy_from_read_buf(struct tty_struct *tty,
|
||||
if (eol == N_TTY_BUF_SIZE && more) {
|
||||
/* scan wrapped without finding set bit */
|
||||
eol = find_next_bit(ldata->read_flags, more, 0);
|
||||
if (eol != more)
|
||||
found = 1;
|
||||
} else if (eol != size)
|
||||
found = 1;
|
||||
found = eol != more;
|
||||
} else
|
||||
found = eol != size;
|
||||
|
||||
n = eol - tail;
|
||||
if (n > N_TTY_BUF_SIZE)
|
||||
|
Loading…
Reference in New Issue
Block a user