]> git.baikalelectronics.ru Git - kernel.git/commit
n_tty: Replace canon_data with index comparison
authorPeter Hurley <peter@hurleysoftware.com>
Sat, 15 Jun 2013 13:14:25 +0000 (09:14 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 23 Jul 2013 23:43:01 +0000 (16:43 -0700)
commit58c15e4a55947d1784f05e6a2cc5e4aa9d26000b
treef6bc7f43c964c3d045c104de054de5b0b83bacdf
parentc1da22e05a487a08eda64283f031c5f4ba06a9fa
n_tty: Replace canon_data with index comparison

canon_data represented the # of lines which had been copied
to the receive buffer but not yet copied to the user buffer.
The value was tested to determine if input was available in
canonical mode (and also to force input overrun if the
receive buffer was full but a newline had not been received).

However, the actual count was irrelevent; only whether it was
non-zero (meaning 'is there any input to transfer?'). This
shared count is unnecessary and unsafe with a lockless algorithm.
The same check is made by comparing canon_head with read_tail instead.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/n_tty.c