diff options
author | Alan Cox <alan@lxorguk.ukuu.org.uk> | 2006-09-29 05:00:40 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-29 12:18:16 -0400 |
commit | 1266b1e1aed0a4d7d5cb569deca8c31cba34a990 (patch) | |
tree | 068b6914c89efd98fb75ff0eb3fa952ec92b56fa /drivers/char | |
parent | 0b4a8a789a328af6aac613734c362cf6aad72201 (diff) |
[PATCH] tty: trivial kzalloc opportunity
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/tty_io.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index 2a1e95b0f282..18085a20df23 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); | |||
160 | * been initialized in any way but has been zeroed | 160 | * been initialized in any way but has been zeroed |
161 | * | 161 | * |
162 | * Locking: none | 162 | * Locking: none |
163 | * FIXME: use kzalloc | ||
164 | */ | 163 | */ |
165 | 164 | ||
166 | static struct tty_struct *alloc_tty_struct(void) | 165 | static struct tty_struct *alloc_tty_struct(void) |
167 | { | 166 | { |
168 | struct tty_struct *tty; | 167 | return kzalloc(sizeof(struct tty_struct), GFP_KERNEL); |
169 | |||
170 | tty = kmalloc(sizeof(struct tty_struct), GFP_KERNEL); | ||
171 | if (tty) | ||
172 | memset(tty, 0, sizeof(struct tty_struct)); | ||
173 | return tty; | ||
174 | } | 168 | } |
175 | 169 | ||
176 | static void tty_buffer_free_all(struct tty_struct *); | 170 | static void tty_buffer_free_all(struct tty_struct *); |