From: Alan Cox Date: Fri, 29 Sep 2006 09:00:40 +0000 (-0700) Subject: [PATCH] tty: trivial kzalloc opportunity X-Git-Tag: v2.6.19-rc1~736 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=1266b1e1aed0a4d7d5cb569deca8c31cba34a990;p=linux-2.6-omap-h63xx.git [PATCH] tty: trivial kzalloc opportunity Signed-off-by: Alan Cox Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index 2a1e95b0f28..18085a20df2 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c @@ -160,17 +160,11 @@ static void release_mem(struct tty_struct *tty, int idx); * been initialized in any way but has been zeroed * * Locking: none - * FIXME: use kzalloc */ static struct tty_struct *alloc_tty_struct(void) { - struct tty_struct *tty; - - tty = kmalloc(sizeof(struct tty_struct), GFP_KERNEL); - if (tty) - memset(tty, 0, sizeof(struct tty_struct)); - return tty; + return kzalloc(sizeof(struct tty_struct), GFP_KERNEL); } static void tty_buffer_free_all(struct tty_struct *);