Skip to content

Commit

Permalink
tty: dont needlessly cast kmalloc() return value
Browse files Browse the repository at this point in the history
kmalloc() hands us a void pointer, we don't need to cast it.

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Jesper Juhl authored and Linus Torvalds committed Aug 24, 2007
1 parent 87bd1e9 commit abcb1ff
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/char/tty_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -2063,8 +2063,7 @@ static int init_dev(struct tty_driver *driver, int idx,
}

if (!*tp_loc) {
tp = (struct ktermios *) kmalloc(sizeof(struct ktermios),
GFP_KERNEL);
tp = kmalloc(sizeof(struct ktermios), GFP_KERNEL);
if (!tp)
goto free_mem_out;
*tp = driver->init_termios;
Expand Down Expand Up @@ -2094,8 +2093,7 @@ static int init_dev(struct tty_driver *driver, int idx,
}

if (!*o_tp_loc) {
o_tp = (struct ktermios *)
kmalloc(sizeof(struct ktermios), GFP_KERNEL);
o_tp = kmalloc(sizeof(struct ktermios), GFP_KERNEL);
if (!o_tp)
goto free_mem_out;
*o_tp = driver->other->init_termios;
Expand Down

0 comments on commit abcb1ff

Please sign in to comment.