Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751866AbbGMAvO (ORCPT ); Sun, 12 Jul 2015 20:51:14 -0400 Received: from mail-qg0-f42.google.com ([209.85.192.42]:36710 "EHLO mail-qg0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751405AbbGMAvD (ORCPT ); Sun, 12 Jul 2015 20:51:03 -0400 From: Peter Hurley To: Greg Kroah-Hartman Cc: Jiri Slaby , linux-kernel@vger.kernel.org, Peter Hurley Subject: [PATCH 2/2] tty: buffers: Move hidden buffer index advance into outer loop Date: Sun, 12 Jul 2015 20:50:50 -0400 Message-Id: <1436748650-4389-2-git-send-email-peter@hurleysoftware.com> X-Mailer: git-send-email 2.4.5 In-Reply-To: <1436748650-4389-1-git-send-email-peter@hurleysoftware.com> References: <1436748650-4389-1-git-send-email-peter@hurleysoftware.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1102 Lines: 38 The advance of the 'read' buffer index belongs in the outer flip buffer consume loop, with the other buffer index arithmetic. No functional change. Signed-off-by: Peter Hurley --- drivers/tty/tty_buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/tty_buffer.c b/drivers/tty/tty_buffer.c index 25ba5af..5a3fa89 100644 --- a/drivers/tty/tty_buffer.c +++ b/drivers/tty/tty_buffer.c @@ -444,7 +444,6 @@ receive_buf(struct tty_struct *tty, struct tty_buffer *head, int count) if (count) disc->ops->receive_buf(tty, p, f, count); } - head->read += count; return count; } @@ -506,6 +505,7 @@ static void flush_to_ldisc(struct work_struct *work) count = receive_buf(tty, head, count); if (!count) break; + head->read += count; } mutex_unlock(&buf->lock); -- 2.4.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/