usb: gadget: bdc: prefer pointer dereference to pointer type
authorChunfeng Yun <chunfeng.yun@mediatek.com>
Wed, 13 Jan 2021 02:42:20 +0000 (10:42 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Jan 2021 10:24:02 +0000 (11:24 +0100)
Prefer kzalloc(sizeof(*bd_table)...) over
kzalloc(sizeof(struct bd_table)

Cc: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/1610505748-30616-3-git-send-email-chunfeng.yun@mediatek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/udc/bdc/bdc_ep.c

index fafdc9f..76463de 100644 (file)
@@ -147,7 +147,7 @@ static int ep_bd_list_alloc(struct bdc_ep *ep)
        /* Allocate memory for each table */
        for (index = 0; index < num_tabs; index++) {
                /* Allocate memory for bd_table structure */
-               bd_table = kzalloc(sizeof(struct bd_table), GFP_ATOMIC);
+               bd_table = kzalloc(sizeof(*bd_table), GFP_ATOMIC);
                if (!bd_table)
                        goto fail;