public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jaya Durga <rjdurga@gmail.com>
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 <rjdurga@gmail.com>, Jaya Durga <jayad@cdac.in>
Subject: [PATCH 7/7] Staging: rtl8712 : rtl871x_io.c:fix coding style of kmalloc usage
Date: Tue,  4 Jul 2017 16:11:31 +0530	[thread overview]
Message-ID: <1499164891-7185-1-git-send-email-rjdurga@gmail.com> (raw)

CHECK: multiple assignments should be avoided
CHECK: Prefer kmalloc(sizeof(*pintf_hdl->pintfpriv)...) 
over kmalloc(sizeof(struct intf_priv)...)

Signed-off-by: Jaya Durga <jayad@cdac.in>
---
 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

             reply	other threads:[~2017-07-04 10:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-04 10:41 Jaya Durga [this message]
2017-07-11 17:09 ` [PATCH 7/7] Staging: rtl8712 : rtl871x_io.c:fix coding style of kmalloc usage Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1499164891-7185-1-git-send-email-rjdurga@gmail.com \
    --to=rjdurga@gmail.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=devel@driverdev.osuosl.org \
    --cc=florian.c.schilhabel@googlemail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jayad@cdac.in \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox