lkml.org 
[lkml]   [2007]   [May]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] tty_io: Use kzalloc
On Fri, 25 May 2007, Jean Delvare wrote:

> Signed-off-by: Jean Delvare <khali@linux-fr.org>
> ---
> Andrew, can you please pick this? I couldn't find any maintainer for
> this driver. Thanks.
>
> drivers/char/tty_io.c | 9 +++------
> 1 file changed, 3 insertions(+), 6 deletions(-)
>
> --- linux-2.6.22-rc2.orig/drivers/char/tty_io.c 2007-05-25 08:43:16.000000000 +0200
> +++ linux-2.6.22-rc2/drivers/char/tty_io.c 2007-05-25 08:43:24.000000000 +0200
> @@ -2009,11 +2009,10 @@ static int init_dev(struct tty_driver *d
> }
>
> if (!*ltp_loc) {
> - ltp = (struct ktermios *) kmalloc(sizeof(struct ktermios),
> + ltp = (struct ktermios *) kzalloc(sizeof(struct ktermios),
> GFP_KERNEL);
> if (!ltp)
> goto free_mem_out;
> - memset(ltp, 0, sizeof(struct ktermios));
> }
>
> if (driver->type == TTY_DRIVER_TYPE_PTY) {
> @@ -2043,10 +2042,9 @@ static int init_dev(struct tty_driver *d
>
> if (!*o_ltp_loc) {
> o_ltp = (struct ktermios *)
> - kmalloc(sizeof(struct ktermios), GFP_KERNEL);
> + kzalloc(sizeof(struct ktermios), GFP_KERNEL);
> if (!o_ltp)
> goto free_mem_out;
> - memset(o_ltp, 0, sizeof(struct ktermios));
> }
>
> /*

i believe you can drop the casts from those calls to kzalloc(), no?

rday
--
========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://fsdev.net/wiki/index.php?title=Main_Page
========================================================================
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-05-25 12:49    [W:0.067 / U:1.472 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site