All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH tty-next 0/3] misc N_TTY termios fixes
@ 2013-09-17 16:53 Peter Hurley
  2013-09-17 16:53 ` [PATCH tty-next 1/3] n_tty: Remove superfluous reader wakeup Peter Hurley
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Peter Hurley @ 2013-09-17 16:53 UTC (permalink / raw
  To: Greg Kroah-Hartman; +Cc: Jiri Slaby, linux-kernel, linux-serial, Peter Hurley

Hi Greg,

These 3 patches correct non-critical issues in n_tty_set_termios().
Please apply for linux-next.

Thanks,

Peter Hurley (3):
  n_tty: Remove superfluous reader wakeup
  n_tty: Remove unnecessary local variable
  n_tty: Style fix in n_tty_set_termios

 drivers/tty/n_tty.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

-- 
1.8.1.2


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH tty-next 1/3] n_tty: Remove superfluous reader wakeup
  2013-09-17 16:53 [PATCH tty-next 0/3] misc N_TTY termios fixes Peter Hurley
@ 2013-09-17 16:53 ` Peter Hurley
  2013-09-17 16:53 ` [PATCH tty-next 2/3] n_tty: Remove unnecessary local variable Peter Hurley
  2013-09-17 16:53 ` [PATCH tty-next 3/3] n_tty: Style fix in n_tty_set_termios Peter Hurley
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Hurley @ 2013-09-17 16:53 UTC (permalink / raw
  To: Greg Kroah-Hartman; +Cc: Jiri Slaby, linux-kernel, linux-serial, Peter Hurley

n_tty's .set_termios method unconditionally performs reader wakeup;
remove extra reader wakeup for canonical mode changes.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
---
 drivers/tty/n_tty.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c
index 01bf5eb..42d7ae7 100644
--- a/drivers/tty/n_tty.c
+++ b/drivers/tty/n_tty.c
@@ -1763,9 +1763,6 @@ static void n_tty_set_termios(struct tty_struct *tty, struct ktermios *old)
 		ldata->lnext = 0;
 	}
 
-	if (canon_change && !L_ICANON(tty) && read_cnt(ldata))
-		wake_up_interruptible(&tty->read_wait);
-
 	ldata->icanon = (L_ICANON(tty) != 0);
 
 	if (I_ISTRIP(tty) || I_IUCLC(tty) || I_IGNCR(tty) ||
-- 
1.8.1.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH tty-next 2/3] n_tty: Remove unnecessary local variable
  2013-09-17 16:53 [PATCH tty-next 0/3] misc N_TTY termios fixes Peter Hurley
  2013-09-17 16:53 ` [PATCH tty-next 1/3] n_tty: Remove superfluous reader wakeup Peter Hurley
@ 2013-09-17 16:53 ` Peter Hurley
  2013-09-17 16:53 ` [PATCH tty-next 3/3] n_tty: Style fix in n_tty_set_termios Peter Hurley
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Hurley @ 2013-09-17 16:53 UTC (permalink / raw
  To: Greg Kroah-Hartman; +Cc: Jiri Slaby, linux-kernel, linux-serial, Peter Hurley

Flatten conditional evaluation in n_tty_set_termios; remove
canon_change.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
---
 drivers/tty/n_tty.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c
index 42d7ae7..28c468c 100644
--- a/drivers/tty/n_tty.c
+++ b/drivers/tty/n_tty.c
@@ -1752,11 +1752,8 @@ int is_ignored(int sig)
 static void n_tty_set_termios(struct tty_struct *tty, struct ktermios *old)
 {
 	struct n_tty_data *ldata = tty->disc_data;
-	int canon_change = 1;
 
-	if (old)
-		canon_change = (old->c_lflag ^ tty->termios.c_lflag) & ICANON;
-	if (canon_change) {
+	if (!old || (old->c_lflag ^ tty->termios.c_lflag) & ICANON) {
 		bitmap_zero(ldata->read_flags, N_TTY_BUF_SIZE);
 		ldata->line_start = ldata->canon_head = ldata->read_tail;
 		ldata->erasing = 0;
-- 
1.8.1.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH tty-next 3/3] n_tty: Style fix in n_tty_set_termios
  2013-09-17 16:53 [PATCH tty-next 0/3] misc N_TTY termios fixes Peter Hurley
  2013-09-17 16:53 ` [PATCH tty-next 1/3] n_tty: Remove superfluous reader wakeup Peter Hurley
  2013-09-17 16:53 ` [PATCH tty-next 2/3] n_tty: Remove unnecessary local variable Peter Hurley
@ 2013-09-17 16:53 ` Peter Hurley
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Hurley @ 2013-09-17 16:53 UTC (permalink / raw
  To: Greg Kroah-Hartman; +Cc: Jiri Slaby, linux-kernel, linux-serial, Peter Hurley

Remove braces from single-statement conditional in
n_tty_set_termios.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
---
 drivers/tty/n_tty.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c
index 28c468c..09505ff 100644
--- a/drivers/tty/n_tty.c
+++ b/drivers/tty/n_tty.c
@@ -1814,9 +1814,8 @@ static void n_tty_set_termios(struct tty_struct *tty, struct ktermios *old)
 	 * Fix tty hang when I_IXON(tty) is cleared, but the tty
 	 * been stopped by STOP_CHAR(tty) before it.
 	 */
-	if (!I_IXON(tty) && old && (old->c_iflag & IXON) && !tty->flow_stopped) {
+	if (!I_IXON(tty) && old && (old->c_iflag & IXON) && !tty->flow_stopped)
 		start_tty(tty);
-	}
 
 	/* The termios change make the tty ready for I/O */
 	wake_up_interruptible(&tty->write_wait);
-- 
1.8.1.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-09-17 16:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-17 16:53 [PATCH tty-next 0/3] misc N_TTY termios fixes Peter Hurley
2013-09-17 16:53 ` [PATCH tty-next 1/3] n_tty: Remove superfluous reader wakeup Peter Hurley
2013-09-17 16:53 ` [PATCH tty-next 2/3] n_tty: Remove unnecessary local variable Peter Hurley
2013-09-17 16:53 ` [PATCH tty-next 3/3] n_tty: Style fix in n_tty_set_termios Peter Hurley

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.