Skip to contentSkip to conversation

Drop pointer cast and remove CamelCase

PATCH New Janani Ravichandran 1 participant 3 messages Feb 25, 2016 Staging

lore
Share & tools
lore
#0 lore raw

cover Drop pointer cast and remove CamelCase

This patchset drops cast on a void pointer and removes CamelCase on the name of the pointer variable

Janani Ravichandran (2):
staging: rtl8723au: core: Drop unneeded pointer cast
staging: rtl8723au: core: Remove camelcasing

 drivers/staging/rtl8723au/core/rtw_security.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Signature · 1 line
2.5.0
#1 lore raw

PATCH 1/2 staging: rtl8723au: core: Drop unneeded pointer cast

Void pointers don't need to be cast to other pointer types. Semantic patch used:

@r@
expression x;
void* e;
type T;
identifier f;
@@

(
*((T *)e)
|
((T *)x) [...]
|
((T *)x)->f
|
- (T *)
e
)

---
 drivers/staging/rtl8723au/core/rtw_security.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8723au/core/rtw_security.c +1 -1
index 038b57b..9d2a013 100644
@@ -1619,7 +1619,7 @@ exit:
 
 void rtw_use_tkipkey_handler23a(void *FunctionContext)
 {
-	struct rtw_adapter *padapter = (struct rtw_adapter *)FunctionContext;
+	struct rtw_adapter *padapter = FunctionContext;
 
 	RT_TRACE(_module_rtl871x_security_c_, _drv_err_,
 		 "^^^%s ^^^\n", __func__);
Signature · 1 line
2.5.0
#2 lore raw

PATCH 2/2 staging: rtl8723au: core: Remove CamelCase

In reply to Janani Ravichandran

Remove CamelCase on the variable FunctionContext.

---
 drivers/staging/rtl8723au/core/rtw_security.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8723au/core/rtw_security.c +2 -2
index 9d2a013..411d138 100644
@@ -1617,9 +1617,9 @@ exit:
 	return res;
 }
 
-void rtw_use_tkipkey_handler23a(void *FunctionContext)
+void rtw_use_tkipkey_handler23a(void *function_context)
 {
-	struct rtw_adapter *padapter = FunctionContext;
+	struct rtw_adapter *padapter = function_context;
 
 	RT_TRACE(_module_rtl871x_security_c_, _drv_err_,
 		 "^^^%s ^^^\n", __func__);
Signature · 1 line
2.5.0