Skip to content

Commit 7cf9a79

Browse files
Sam Muhammedgregkh
authored andcommitted
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>
1 parent eb538ff commit 7cf9a79

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/staging/speakup/spk_ttyio.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ static int spk_ttyio_ldisc_open(struct tty_struct *tty)
5151
return -EOPNOTSUPP;
5252
speakup_tty = tty;
5353

54-
ldisc_data = kmalloc(sizeof(struct spk_ldisc_data), GFP_KERNEL);
54+
ldisc_data = kmalloc(sizeof(*ldisc_data), GFP_KERNEL);
5555
if (!ldisc_data)
5656
return -ENOMEM;
5757

0 commit comments

Comments
 (0)