From: Jiri Slaby <jslaby@suse.cz>
To: Ilya Zykov <ilya@ilyx.ru>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Alan Cox <alan@linux.intel.com>,
linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org
Subject: Re: [PATCH -next 2/2] tty: Correct tty buffer flush.
Date: Wed, 05 Dec 2012 10:35:16 +0100 [thread overview]
Message-ID: <50BF1554.50303@suse.cz> (raw)
In-Reply-To: <50BF0A56.9050209@ilyx.ru>
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@ilyx.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
next prev parent reply other threads:[~2012-12-05 9:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-05 8:48 [PATCH -next 2/2] tty: Correct tty buffer flush Ilya Zykov
2012-12-05 9:35 ` Jiri Slaby [this message]
2012-12-05 12:53 ` Ilya Zykov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50BF1554.50303@suse.cz \
--to=jslaby@suse.cz \
--cc=alan@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=ilya@ilyx.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox