Skip to contentSkip to conversation

Staging: rtl8723bs/os_dep: Remove typecast in kfree

PATCH In review Meghana Madhyastha 2 participants 2 messages Sep 16, 2017 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: rtl8723bs/os_dep: Remove typecast in kfree

Remove typecast of pointer in kfree((u8 *)pdvobj) as it is not needed.

Found using the following Coccinelle semantic patch:
@@
identifier x;
type t;
@@

-kfree((t *)x)
+kfree(x)

---
 drivers/staging/rtl8723bs/os_dep/os_intfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8723bs/os_dep/os_intfs.c +1 -1
index f509713..51df42d 100644
@@ -719,7 +719,7 @@ void devobj_deinit(struct dvobj_priv *pdvobj)
 	mutex_destroy(&pdvobj->setch_mutex);
 	mutex_destroy(&pdvobj->setbw_mutex);
 
-	kfree((u8 *)pdvobj);
+	kfree(pdvobj);
 }
 
 u8 rtw_reset_drv_sw(struct adapter *padapter)
Signature · 1 line
2.7.4
Acked-by on v1 1/1
#1 lore raw
Quoted 12 lines · Meghana Madhyastha

Remove typecast of pointer in kfree((u8 *)pdvobj) as it is not needed.

Found using the following Coccinelle semantic patch:
@@
identifier x;
type t;
@@

(quoted diff) +1 -1
-kfree((t *)x)
+kfree(x)
Quoted 1 line
Quoted 27 lines
---
 drivers/staging/rtl8723bs/os_dep/os_intfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8723bs/os_dep/os_intfs.c +1 -2
index f509713..51df42d 100644
@@ -719,7 +719,7 @@ void devobj_deinit(struct dvobj_priv *pdvobj)
 	mutex_destroy(&pdvobj->setch_mutex);
 	mutex_destroy(&pdvobj->setbw_mutex);
 
-	kfree((u8 *)pdvobj);
+	kfree(pdvobj);
 }
 
 u8 rtw_reset_drv_sw(struct adapter *padapter)
--

2.7.4

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20170916081210.GA19333%40meghana-HP-Pavilion-Notebook.
For more options, visit https://groups.google.com/d/optout.