Skip to contentSkip to conversation

staging: ks7010: Remove initialisation

PATCH In review Nishka Dasgupta 2 participants 2 messages May 24, 2019 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: ks7010: Remove initialisation

The initial value of return variable ret is never used, so it can be removed.
Issue found with Coccinelle.

---
 drivers/staging/ks7010/ks_hostif.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/ks7010/ks_hostif.c +1 -1
index e089366ed02a..3775fd4b89ae 100644
@@ -1067,7 +1067,7 @@ int hostif_data_request(struct ks_wlan_private *priv, struct sk_buff *skb)
 	unsigned int length = 0;
 	struct hostif_data_request *pp;
 	unsigned char *p;
-	int result = 0;
+	int result;
 	unsigned short eth_proto;
 	struct ether_hdr *eth_hdr;
 	unsigned short keyinfo = 0;
Signature · 1 line
2.19.1
#1 lore raw
Quoted 14 lines · Nishka Dasgupta

The initial value of return variable ret is never used, so it can be removed.
Issue found with Coccinelle.

---
 drivers/staging/ks7010/ks_hostif.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/ks7010/ks_hostif.c +0 -0
index e089366ed02a..3775fd4b89ae 100644

drivers/staging/ks7010/ks_hostif.c int hostif_data_request(struct ks_wlan_private *priv, struct sk_buff *skb) · line 1070

Quoted 5 lines
drivers/staging/ks7010/ks_hostif.c +1 -1
@@ -1067,7 +1067,7 @@ int hostif_data_request(struct ks_wlan_private *priv, struct sk_buff *skb)
 	unsigned int length = 0;
 	struct hostif_data_request *pp;
 	unsigned char *p;
-	int result = 0;
+	int result;

You should get rid of the result variable completely and just use "ret" instead. No need for two variables.

regards,
dan carpenter