Re: [PATCH 2.6.20-rc3] TTY_IO: Remove unnecessary kmalloc casts

From: Rolf Eike Beer
Date: Fri Jan 05 2007 - 03:11:17 EST


Ahmed S. Darwish wrote:
> Remove unnecessary kmalloc casts in drivers/char/tty_io.c
>
> Signed-off-by: Ahmed Darwish <darwish.07@xxxxxxxxx>

> 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

Attachment: pgp00000.pgp
Description: PGP signature