mirror of
https://github.com/torvalds/linux
synced 2024-09-27 06:50:51 +00:00
tty: Use generic names for flip buffer list cursors
Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
11b9faa44d
commit
2cf7b67e87
|
@ -44,15 +44,15 @@ static void tty_buffer_reset(struct tty_buffer *p, size_t size)
|
||||||
void tty_buffer_free_all(struct tty_port *port)
|
void tty_buffer_free_all(struct tty_port *port)
|
||||||
{
|
{
|
||||||
struct tty_bufhead *buf = &port->buf;
|
struct tty_bufhead *buf = &port->buf;
|
||||||
struct tty_buffer *thead;
|
struct tty_buffer *p;
|
||||||
|
|
||||||
while ((thead = buf->head) != NULL) {
|
while ((p = buf->head) != NULL) {
|
||||||
buf->head = thead->next;
|
buf->head = p->next;
|
||||||
kfree(thead);
|
kfree(p);
|
||||||
}
|
}
|
||||||
while ((thead = buf->free) != NULL) {
|
while ((p = buf->free) != NULL) {
|
||||||
buf->free = thead->next;
|
buf->free = p->next;
|
||||||
kfree(thead);
|
kfree(p);
|
||||||
}
|
}
|
||||||
buf->tail = NULL;
|
buf->tail = NULL;
|
||||||
buf->memory_used = 0;
|
buf->memory_used = 0;
|
||||||
|
@ -143,13 +143,13 @@ static void tty_buffer_free(struct tty_port *port, struct tty_buffer *b)
|
||||||
static void __tty_buffer_flush(struct tty_port *port)
|
static void __tty_buffer_flush(struct tty_port *port)
|
||||||
{
|
{
|
||||||
struct tty_bufhead *buf = &port->buf;
|
struct tty_bufhead *buf = &port->buf;
|
||||||
struct tty_buffer *thead;
|
struct tty_buffer *next;
|
||||||
|
|
||||||
if (unlikely(buf->head == NULL))
|
if (unlikely(buf->head == NULL))
|
||||||
return;
|
return;
|
||||||
while ((thead = buf->head->next) != NULL) {
|
while ((next = buf->head->next) != NULL) {
|
||||||
tty_buffer_free(port, buf->head);
|
tty_buffer_free(port, buf->head);
|
||||||
buf->head = thead;
|
buf->head = next;
|
||||||
}
|
}
|
||||||
WARN_ON(buf->head != buf->tail);
|
WARN_ON(buf->head != buf->tail);
|
||||||
buf->head->read = buf->head->commit;
|
buf->head->read = buf->head->commit;
|
||||||
|
|
Loading…
Reference in a new issue