[PATCH 1/2] tty: remove redundant initialization in initialize_tty_struct()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Signed-off-by: Yan Hong <clouds.yan@xxxxxxxxx>
---
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

--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux