tty: Simplify flip buffer list with 0-sized sentinel
authorPeter Hurley <peter@hurleysoftware.com>
Sat, 15 Jun 2013 13:36:07 +0000 (09:36 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 23 Jul 2013 23:47:08 +0000 (16:47 -0700)
commit7391ee16950e772076d321792d9fbf030f921345
treec0b17ff0622f801f05bb11228426bdc90e8ffdc2
parent809850b7a5fcc0a96d023e1171a7944c60fd5a71
tty: Simplify flip buffer list with 0-sized sentinel

Use a 0-sized sentinel to avoid assigning the head ptr from
the driver side thread. This also eliminates testing head/tail
for NULL.

When the sentinel is first 'consumed' by the buffer work
(or by tty_buffer_flush()), it is detached from the list but not
freed nor added to the free list. Both buffer work and
tty_buffer_flush() continue to preserve at least 1 flip buffer
to which head & tail is pointed.

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