aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorPeter Hurley <peter@hurleysoftware.com>2015-11-27 14:11:04 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-12-13 22:59:48 -0500
commitb985e9e368f0db4fee940ad86197f413779d4b63 (patch)
tree45922ca0c6e3d0f3d1519516075280aa977b3119 /drivers/tty
parente661cf702003030daf2001cb88eb586300a18ee4 (diff)
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>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/n_tty.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c
index bc613b868e71..f2f64252814f 100644
--- a/drivers/tty/n_tty.c
+++ b/drivers/tty/n_tty.c
@@ -2080,10 +2080,9 @@ static int canon_copy_from_read_buf(struct tty_struct *tty,
2080 if (eol == N_TTY_BUF_SIZE && more) { 2080 if (eol == N_TTY_BUF_SIZE && more) {
2081 /* scan wrapped without finding set bit */ 2081 /* scan wrapped without finding set bit */
2082 eol = find_next_bit(ldata->read_flags, more, 0); 2082 eol = find_next_bit(ldata->read_flags, more, 0);
2083 if (eol != more) 2083 found = eol != more;
2084 found = 1; 2084 } else
2085 } else if (eol != size) 2085 found = eol != size;
2086 found = 1;
2087 2086
2088 n = eol - tail; 2087 n = eol - tail;
2089 if (n > N_TTY_BUF_SIZE) 2088 if (n > N_TTY_BUF_SIZE)