Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752323AbdGDKqj (ORCPT ); Tue, 4 Jul 2017 06:46:39 -0400 Received: from mail-it0-f65.google.com ([209.85.214.65]:35015 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752180AbdGDKqi (ORCPT ); Tue, 4 Jul 2017 06:46:38 -0400 From: Jaya Durga To: gregkh@linuxfoundation.org Cc: Larry.Finger@lwfinger.net, florian.c.schilhabel@googlemail.com, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Jaya Durga , Jaya Durga Subject: [PATCH 7/7] Staging: rtl8712 : rtl871x_io.c:fix coding style of kmalloc usage Date: Tue, 4 Jul 2017 16:11:31 +0530 Message-Id: <1499164891-7185-1-git-send-email-rjdurga@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 999 Lines: 26 CHECK: multiple assignments should be avoided CHECK: Prefer kmalloc(sizeof(*pintf_hdl->pintfpriv)...) over kmalloc(sizeof(struct intf_priv)...) Signed-off-by: Jaya Durga --- drivers/staging/rtl8712/rtl871x_io.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/rtl8712/rtl871x_io.c b/drivers/staging/rtl8712/rtl871x_io.c index 3a10940..b8b47c4 100644 --- a/drivers/staging/rtl8712/rtl871x_io.c +++ b/drivers/staging/rtl8712/rtl871x_io.c @@ -60,8 +60,9 @@ static uint _init_intf_hdl(struct _adapter *padapter, set_intf_funs = &(r8712_usb_set_intf_funs); set_intf_ops = &r8712_usb_set_intf_ops; init_intf_priv = &r8712_usb_init_intf_priv; - pintf_priv = pintf_hdl->pintfpriv = kmalloc(sizeof(struct intf_priv), + pintf_hdl->pintfpriv = kmalloc(sizeof(*pintf_hdl->pintfpriv), GFP_ATOMIC); + pintf_priv = pintf_hdl->pintfpriv; if (pintf_priv == NULL) goto _init_intf_hdl_fail; pintf_hdl->adapter = (u8 *)padapter; -- 1.9.1