lkml.org 
[lkml]   [2007]   [Jan]   [5]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
FromRolf Eike Beer <>
SubjectRe: [PATCH 2.6.20-rc3] TTY_IO: Remove unnecessary kmalloc casts
DateFri, 5 Jan 2007 09:10:01 +0100
Ahmed S. Darwish wrote:
> Remove unnecessary kmalloc casts in drivers/char/tty_io.c
>
> Signed-off-by: Ahmed Darwish <darwish.07@gmail.com>

>  	if (!*ltp_loc) {
> -		ltp = (struct ktermios *) kmalloc(sizeof(struct ktermios),
> -						 GFP_KERNEL);
> +		ltp = kmalloc(sizeof(struct ktermios), GFP_KERNEL);
                      ^^^^^^^
>  		if (!ltp)
>  			goto free_mem_out;
>  		memset(ltp, 0, sizeof(struct ktermios));
                ^^^^^^

kzalloc

>  		if (!*o_ltp_loc) {
> -			o_ltp = (struct ktermios *)
> -				kmalloc(sizeof(struct ktermios), GFP_KERNEL);
> +			o_ltp = kmalloc(sizeof(struct ktermios), GFP_KERNEL);
                                ^^^^^^^
>  			if (!o_ltp)
>  				goto free_mem_out;
>  			memset(o_ltp, 0, sizeof(struct ktermios));
                        ^^^^^^

kzalloc

HTH

Eike
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2007-01-05 09:13    [from the cache]
©2003-2008