Let's get rid of the typecast - eh?
The patch titled
tty: trivial kzalloc opportunity
has been added to the -mm tree. Its filename is
tty-trivial-kzalloc-opportunity.patch
See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this
------------------------------------------------------
Subject: tty: trivial kzalloc opportunity
From: Alan Cox <alan@xxxxxxxxxxxxxxxxxxx>
Signed-off-by: Alan Cox <alan@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---
drivers/char/tty_io.c | 8 +-------
1 files changed, 1 insertion(+), 7 deletions(-)
diff -puN drivers/char/tty_io.c~tty-trivial-kzalloc-opportunity drivers/char/tty_io.c
--- a/drivers/char/tty_io.c~tty-trivial-kzalloc-opportunity
+++ a/drivers/char/tty_io.c
@@ -160,17 +160,11 @@ static void release_mem(struct tty_struc
* 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 (struct tty_struct *)kzalloc(sizeof(struct tty_struct), GFP_KERNEL);
}