staging: wilc1000: fix coding style of kmalloc usage
authorChaehyun Lim <chaehyun.lim@gmail.com>
Thu, 21 Jan 2016 11:30:55 +0000 (20:30 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Feb 2016 23:21:18 +0000 (15:21 -0800)
This patch fixes coding style of kmalloc usage found by checkpatch.
CHECK: Prefer kmalloc(sizeof(*new_msg)...) over kmalloc(sizeof(struct message)...)

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wilc1000/wilc_msgqueue.c

index 71077157033cf217763d74004358bb4a4b3d2211..c7a60f44db77baf80ec710d76234fb97ca509ad4 100644 (file)
@@ -70,7 +70,7 @@ int wilc_mq_send(struct message_queue *mq,
        }
 
        /* construct a new message */
-       new_msg = kmalloc(sizeof(struct message), GFP_ATOMIC);
+       new_msg = kmalloc(sizeof(*new_msg), GFP_ATOMIC);
        if (!new_msg)
                return -ENOMEM;