Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Sam Muhammed <jane.pnx9@gmail.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Link: https://lore.kernel.org/r/19494bdab5709693126e0c0ee14b179a3b601207.1585046066.git.jane.pnx9@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Sam Muhammed and committed by
Greg Kroah-Hartman
7cf9a79d eb538ff0

+1 -1
+1 -1
drivers/staging/speakup/spk_ttyio.c
··· 51 51 return -EOPNOTSUPP; 52 52 speakup_tty = tty; 53 53 54 - ldisc_data = kmalloc(sizeof(struct spk_ldisc_data), GFP_KERNEL); 54 + ldisc_data = kmalloc(sizeof(*ldisc_data), GFP_KERNEL); 55 55 if (!ldisc_data) 56 56 return -ENOMEM; 57 57