Commit 7cf9a79d authored by Sam Muhammed's avatar Sam Muhammed Committed by Greg Kroah-Hartman

Staging: speakup: Use sizeof(*var) in kmalloc().

Modifying struct allocation in kmalloc() to match the
coding standards.

Checkpatch.pl CHECK: Prefer kmalloc(sizeof(*ldisc_data)...)
over kmalloc(sizeof(struct spk_ldisc_data)...)
Signed-off-by: default avatarSam Muhammed <jane.pnx9@gmail.com>
Reviewed-by: default avatarSamuel Thibault <samuel.thibault@ens-lyon.org>
Link: https://lore.kernel.org/r/19494bdab5709693126e0c0ee14b179a3b601207.1585046066.git.jane.pnx9@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent eb538ff0
...@@ -51,7 +51,7 @@ static int spk_ttyio_ldisc_open(struct tty_struct *tty) ...@@ -51,7 +51,7 @@ static int spk_ttyio_ldisc_open(struct tty_struct *tty)
return -EOPNOTSUPP; return -EOPNOTSUPP;
speakup_tty = tty; speakup_tty = tty;
ldisc_data = kmalloc(sizeof(struct spk_ldisc_data), GFP_KERNEL); ldisc_data = kmalloc(sizeof(*ldisc_data), GFP_KERNEL);
if (!ldisc_data) if (!ldisc_data)
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment