From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757276Ab3CSTvc (ORCPT ); Tue, 19 Mar 2013 15:51:32 -0400 Received: from mailout02.c08.mtsvc.net ([205.186.168.190]:59731 "EHLO mailout02.c08.mtsvc.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751542Ab3CSTvb (ORCPT ); Tue, 19 Mar 2013 15:51:31 -0400 From: Peter Hurley To: Greg Kroah-Hartman , Ingo Molnar , David Howells Cc: Jiri Slaby , Sasha Levin , Dave Jones , Michel Lespinasse , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Peter Hurley Subject: [PATCH 4/7] tty: Clarify ldisc variable Date: Tue, 19 Mar 2013 15:26:06 -0400 Message-Id: <1363721169-22445-5-git-send-email-peter@hurleysoftware.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1363721169-22445-1-git-send-email-peter@hurleysoftware.com> References: <1363034704-28036-1-git-send-email-peter@hurleysoftware.com> <1363721169-22445-1-git-send-email-peter@hurleysoftware.com> X-Authenticated-User: 125194 peter@hurleysoftware.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Rename o_ldisc to avoid confusion with the ldisc of the 'other' tty. Signed-off-by: Peter Hurley --- drivers/tty/tty_ldisc.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/tty/tty_ldisc.c b/drivers/tty/tty_ldisc.c index a150f95..9ace119 100644 --- a/drivers/tty/tty_ldisc.c +++ b/drivers/tty/tty_ldisc.c @@ -516,7 +516,7 @@ static void tty_ldisc_restore(struct tty_struct *tty, struct tty_ldisc *old) int tty_set_ldisc(struct tty_struct *tty, int ldisc) { int retval; - struct tty_ldisc *o_ldisc, *new_ldisc; + struct tty_ldisc *old_ldisc, *new_ldisc; struct tty_struct *o_tty = tty->link; new_ldisc = tty_ldisc_get(tty, ldisc); @@ -540,7 +540,7 @@ int tty_set_ldisc(struct tty_struct *tty, int ldisc) /* FIXME: why 'shutoff' input if the ldisc is locked? */ tty->receive_room = 0; - o_ldisc = tty->ldisc; + old_ldisc = tty->ldisc; tty_lock(tty); /* FIXME: for testing only */ @@ -555,8 +555,8 @@ int tty_set_ldisc(struct tty_struct *tty, int ldisc) return -EIO; } - /* Shutdown the current discipline. */ - tty_ldisc_close(tty, o_ldisc); + /* Shutdown the old discipline. */ + tty_ldisc_close(tty, old_ldisc); /* Now set up the new line discipline. */ tty->ldisc = new_ldisc; @@ -566,17 +566,17 @@ int tty_set_ldisc(struct tty_struct *tty, int ldisc) if (retval < 0) { /* Back to the old one or N_TTY if we can't */ tty_ldisc_put(new_ldisc); - tty_ldisc_restore(tty, o_ldisc); + tty_ldisc_restore(tty, old_ldisc); } /* At this point we hold a reference to the new ldisc and a a reference to the old ldisc. If we ended up flipping back to the existing ldisc we have two references to it */ - if (tty->ldisc->ops->num != o_ldisc->ops->num && tty->ops->set_ldisc) + if (tty->ldisc->ops->num != old_ldisc->ops->num && tty->ops->set_ldisc) tty->ops->set_ldisc(tty); - tty_ldisc_put(o_ldisc); + tty_ldisc_put(old_ldisc); /* * Allow ldisc referencing to occur again -- 1.8.1.2