linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] tty: remove redundant initialization in initialize_tty_struct()
@ 2012-11-23 14:41 Yan Hong
  2012-11-23 14:41 ` [PATCH 2/2] tty: remove useless initialization in tty_open Yan Hong
  2012-11-23 14:51 ` [PATCH 1/2] tty: remove redundant initialization in initialize_tty_struct() Alan Cox
  0 siblings, 2 replies; 5+ messages in thread
From: Yan Hong @ 2012-11-23 14:41 UTC (permalink / raw)
  To: gregkh; +Cc: linux-serial

tty_struct is already zeroed, no need to zero its field again.

Signed-off-by: Yan Hong <clouds.yan@gmail.com>
---
Actually alloc_tty_struct() already zerod tty_struct. Logically speaking
these two functions can be called independently, but they are always called
in pair in current code. Maybe someday we can arrange only one of them
zero the memory and let the other expect a zeroed tty_struct (and document
this assumption).

 drivers/tty/tty_io.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 2ea176b..e278edf 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -2935,8 +2935,6 @@ void initialize_tty_struct(struct tty_struct *tty,
 	kref_init(&tty->kref);
 	tty->magic = TTY_MAGIC;
 	tty_ldisc_init(tty);
-	tty->session = NULL;
-	tty->pgrp = NULL;
 	tty->overrun_time = jiffies;
 	tty_buffer_init(tty);
 	mutex_init(&tty->legacy_mutex);
-- 
1.7.9.5


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

end of thread, other threads:[~2012-12-20 15:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-23 14:41 [PATCH 1/2] tty: remove redundant initialization in initialize_tty_struct() Yan Hong
2012-11-23 14:41 ` [PATCH 2/2] tty: remove useless initialization in tty_open Yan Hong
2012-11-23 14:51 ` [PATCH 1/2] tty: remove redundant initialization in initialize_tty_struct() Alan Cox
2012-11-23 15:04   ` Yan Hong
2012-12-20 15:55     ` Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).