Skip to contentSkip to conversation

staging: wilc1000: Remove useless cast.

PATCH In review Varsha Rao 2 participants 2 messages Mar 8, 2017 Staging

lore
Share & tools
lore

Varsha Rao

author
#0 lore raw

PATCH 1/1 staging: wilc1000: Remove useless cast.

Variable ip_addr is already declared as pointer to u8. Again explicit type casting of ip_addr to u8, is not required. Hence this patch removes it by using the following coccinelle script.

@@
type T;
T *ptr,p;
@@
(
- (T *)(&p)
+ &p
|
- (T *)ptr
+ ptr
|
- (T *)(ptr)
+ ptr
|
- (T)(p)
+ p
)

---
 drivers/staging/wilc1000/host_interface.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/wilc1000/host_interface.c +1 -1
index 2429c85..b14b3ae 100644
@@ -385,7 +385,7 @@ static void handle_set_ip_address(struct wilc_vif *vif, u8 *ip_addr, u8 idx)
 
 	wid.id = (u16)WID_IP_ADDRESS;
 	wid.type = WID_STR;
-	wid.val = (u8 *)ip_addr;
+	wid.val = ip_addr;
 	wid.size = IP_ALEN;
 
 	ret = wilc_send_config_pkt(vif, SET_CFG, &wid, 1,
Signature · 1 line
2.9.3
Acked-by on v1 1/1
#1 lore raw
Quoted 22 lines · Varsha Rao

Variable ip_addr is already declared as pointer to u8. Again explicit type casting of ip_addr to u8, is not required. Hence this patch removes it by using the following coccinelle script.

@@
type T;
T *ptr,p;
@@
(
- (T *)(&p)
+ &p
|
- (T *)ptr
+ ptr
|
- (T *)(ptr)
+ ptr
|
- (T)(p)
+ p
)

Quoted 1 line
Quoted 27 lines
---
 drivers/staging/wilc1000/host_interface.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/wilc1000/host_interface.c +1 -2
index 2429c85..b14b3ae 100644
@@ -385,7 +385,7 @@ static void handle_set_ip_address(struct wilc_vif *vif, u8 *ip_addr, u8 idx)
 
 	wid.id = (u16)WID_IP_ADDRESS;
 	wid.type = WID_STR;
-	wid.val = (u8 *)ip_addr;
+	wid.val = ip_addr;
 	wid.size = IP_ALEN;
 
 	ret = wilc_send_config_pkt(vif, SET_CFG, &wid, 1,
--

2.9.3

--
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/58bf84cc.0f7c630a.ae1eb.86c4%40mx.google.com.
For more options, visit https://groups.google.com/d/optout.