[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <50BF1554.50303@suse.cz>
Date: Wed, 05 Dec 2012 10:35:16 +0100
From: Jiri Slaby <jslaby@...e.cz>
To: Ilya Zykov <ilya@...x.ru>
CC: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Alan Cox <alan@...ux.intel.com>, linux-kernel@...r.kernel.org,
linux-serial@...r.kernel.org
Subject: Re: [PATCH -next 2/2] tty: Correct tty buffer flush.
On 12/05/2012 09:48 AM, Ilya Zykov wrote:
> tty: Correct tty buffer flush.
NAK just because of the insufficient commit log. That line does not
belong here. Instead, please add here proper description as you have
already done before. IOW what is in 0/2 should be here so that we know
the reasons. 0/2 text is not stored in git. This one is.
> Signed-off-by: Ilya Zykov <ilya@...x.ru>
> ---
> drivers/tty/tty_buffer.c | 11 +++++++----
> 1 files changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/tty/tty_buffer.c b/drivers/tty/tty_buffer.c
> index 7602df8..8a3333d 100644
> --- a/drivers/tty/tty_buffer.c
> +++ b/drivers/tty/tty_buffer.c
> @@ -119,11 +119,14 @@ static void __tty_buffer_flush(struct tty_port *port)
> struct tty_bufhead *buf = &port->buf;
> struct tty_buffer *thead;
>
> - while ((thead = buf->head) != NULL) {
> - buf->head = thead->next;
> - tty_buffer_free(port, thead);
> + if (unlikely(buf->head == NULL))
> + return;
> + while ((thead = buf->head->next) != NULL) {
> + tty_buffer_free(port, buf->head);
> + buf->head = thead;
> }
> - buf->tail = NULL;
> + WARN_ON(buf->head != buf->tail);
> + buf->head->read = buf->head->commit;
> }
>
> /**
>
thanks,
--
js
suse labs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists