]> git.baikalelectronics.ru Git - kernel.git/commit
n_tty: Use separate head and tail indices for echo_buf
authorPeter Hurley <peter@hurleysoftware.com>
Sat, 15 Jun 2013 14:04:22 +0000 (10:04 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 Jul 2013 00:02:21 +0000 (17:02 -0700)
commit1d1f2db843a522e435024f0b7a2f4a706ab8d1ef
treedfce21ff8b94fab6fbe53da5046d4c56ca072f32
parent53f4407af9b756495bd6a34d12c95631274e1ce4
n_tty: Use separate head and tail indices for echo_buf

Instead of using a single index to track the current echo_buf position,
use a head index when adding to the buffer and a tail index when
consuming from the buffer. Allow these head and tail indices to wrap
at max representable value; perform modulo reduction via helper
functions when accessing the buffer.

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