Skip to contentSkip to conversation

Staging: rtl8712 : rtl871x_io.c:fix coding style of kmalloc usage

PATCH In review Jaya Durga 2 participants 2 messages Jul 4, 2017 – Jul 11, 2017 Staging

lore
Share & tools
lore

Jaya Durga

author
#0 lore raw

PATCH 7/7 Staging: rtl8712 : rtl871x_io.c:fix coding style of kmalloc usage

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

---
 drivers/staging/rtl8712/rtl871x_io.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/rtl8712/rtl871x_io.c +2 -1
index 3a10940..b8b47c4 100644
@@ -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;
Signature · 1 line
1.9.1
maintainer
#1 lore raw
Quoted 8 lines · Jaya Durga

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

---
 drivers/staging/rtl8712/rtl871x_io.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Where are the other 6 patches in this series? I can't apply just one of them :(