mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-15 09:55:36 +00:00
tty: dont needlessly cast kmalloc() return value
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>
This commit is contained in:
parent
87bd1e9aaf
commit
abcb1ff326
@ -2063,8 +2063,7 @@ static int init_dev(struct tty_driver *driver, int idx,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!*tp_loc) {
|
if (!*tp_loc) {
|
||||||
tp = (struct ktermios *) kmalloc(sizeof(struct ktermios),
|
tp = kmalloc(sizeof(struct ktermios), GFP_KERNEL);
|
||||||
GFP_KERNEL);
|
|
||||||
if (!tp)
|
if (!tp)
|
||||||
goto free_mem_out;
|
goto free_mem_out;
|
||||||
*tp = driver->init_termios;
|
*tp = driver->init_termios;
|
||||||
@ -2094,8 +2093,7 @@ static int init_dev(struct tty_driver *driver, int idx,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!*o_tp_loc) {
|
if (!*o_tp_loc) {
|
||||||
o_tp = (struct ktermios *)
|
o_tp = kmalloc(sizeof(struct ktermios), GFP_KERNEL);
|
||||||
kmalloc(sizeof(struct ktermios), GFP_KERNEL);
|
|
||||||
if (!o_tp)
|
if (!o_tp)
|
||||||
goto free_mem_out;
|
goto free_mem_out;
|
||||||
*o_tp = driver->other->init_termios;
|
*o_tp = driver->other->init_termios;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user