Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751481AbdCQJ72 (ORCPT ); Fri, 17 Mar 2017 05:59:28 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:34872 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751037AbdCQJ7X (ORCPT ); Fri, 17 Mar 2017 05:59:23 -0400 Subject: Re: [PATCH v2 5/5] staging: rtl8192e: Pass a pointer as an argument to sizeof() instead of struct To: sunil.m@techveda.org References: <20170307171229.GE4171@mwanda> <1489085448-3243-1-git-send-email-sunil.m@techveda.org> <1489085448-3243-6-git-send-email-sunil.m@techveda.org> Cc: linux-kernel@vger.kernel.org From: Suniel Mahesh Message-ID: Date: Fri, 17 Mar 2017 15:28:06 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <1489085448-3243-6-git-send-email-sunil.m@techveda.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1069 Lines: 31 On Friday 10 March 2017 12:20 AM, sunil.m@techveda.org wrote: > From: Suniel Mahesh > > Prefer vzalloc(sizeof(*priv->pFirmware)...) over > vzalloc(sizeof(struct rt_firmware)...) as reported by checkpatch.pl > > Signed-off-by: Suniel Mahesh > --- > Changes for v2: > > - new patch addition to the series > - Rebased on top of next-20170306 > --- > drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c > index fb711d2..a099bce 100644 > --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c > +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c > @@ -965,7 +965,7 @@ static void _rtl92e_init_priv_variable(struct net_device *dev) > > priv->card_type = PCI; > > - priv->pFirmware = vzalloc(sizeof(struct rt_firmware)); > + priv->pFirmware = vzalloc(sizeof(*priv->pFirmware)); > if (!priv->pFirmware) > return -ENOMEM; > skb_queue_head_init(&priv->skb_queue); > ok