Commit bc63f50c authored by Bhaktipriya Shridhar's avatar Bhaktipriya Shridhar Committed by Greg Kroah-Hartman

staging: wilc1000: Removed unused variables

Variables pcgroup_encrypt_val,pccipher_group,pcwpa_version,
hold different values at different stages of the execution of
connect(), however they are not being used anywhere.
Hence, the unused variables have been removed.

This was done using Coccinelle.

@@ type T; identifier i; constant c; @@
-T i;
<... when != i
-i = c;
...>
Signed-off-by: default avatarBhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6e4d1a8d
...@@ -665,9 +665,6 @@ static int connect(struct wiphy *wiphy, struct net_device *dev, ...@@ -665,9 +665,6 @@ static int connect(struct wiphy *wiphy, struct net_device *dev,
u32 i; u32 i;
u8 u8security = NO_ENCRYPT; u8 u8security = NO_ENCRYPT;
enum AUTHTYPE tenuAuth_type = ANY; enum AUTHTYPE tenuAuth_type = ANY;
char *pcgroup_encrypt_val = NULL;
char *pccipher_group = NULL;
char *pcwpa_version = NULL;
struct wilc_priv *priv; struct wilc_priv *priv;
struct host_if_drv *pstrWFIDrv; struct host_if_drv *pstrWFIDrv;
...@@ -711,11 +708,8 @@ static int connect(struct wiphy *wiphy, struct net_device *dev, ...@@ -711,11 +708,8 @@ static int connect(struct wiphy *wiphy, struct net_device *dev,
memset(priv->WILC_WFI_wep_key_len, 0, sizeof(priv->WILC_WFI_wep_key_len)); memset(priv->WILC_WFI_wep_key_len, 0, sizeof(priv->WILC_WFI_wep_key_len));
if (sme->crypto.cipher_group != NO_ENCRYPT) { if (sme->crypto.cipher_group != NO_ENCRYPT) {
pcwpa_version = "Default";
if (sme->crypto.cipher_group == WLAN_CIPHER_SUITE_WEP40) { if (sme->crypto.cipher_group == WLAN_CIPHER_SUITE_WEP40) {
u8security = ENCRYPT_ENABLED | WEP; u8security = ENCRYPT_ENABLED | WEP;
pcgroup_encrypt_val = "WEP40";
pccipher_group = "WLAN_CIPHER_SUITE_WEP40";
priv->WILC_WFI_wep_key_len[sme->key_idx] = sme->key_len; priv->WILC_WFI_wep_key_len[sme->key_idx] = sme->key_len;
memcpy(priv->WILC_WFI_wep_key[sme->key_idx], sme->key, sme->key_len); memcpy(priv->WILC_WFI_wep_key[sme->key_idx], sme->key, sme->key_len);
...@@ -731,8 +725,6 @@ static int connect(struct wiphy *wiphy, struct net_device *dev, ...@@ -731,8 +725,6 @@ static int connect(struct wiphy *wiphy, struct net_device *dev,
sme->key_idx); sme->key_idx);
} else if (sme->crypto.cipher_group == WLAN_CIPHER_SUITE_WEP104) { } else if (sme->crypto.cipher_group == WLAN_CIPHER_SUITE_WEP104) {
u8security = ENCRYPT_ENABLED | WEP | WEP_EXTENDED; u8security = ENCRYPT_ENABLED | WEP | WEP_EXTENDED;
pcgroup_encrypt_val = "WEP104";
pccipher_group = "WLAN_CIPHER_SUITE_WEP104";
priv->WILC_WFI_wep_key_len[sme->key_idx] = sme->key_len; priv->WILC_WFI_wep_key_len[sme->key_idx] = sme->key_len;
memcpy(priv->WILC_WFI_wep_key[sme->key_idx], sme->key, sme->key_len); memcpy(priv->WILC_WFI_wep_key[sme->key_idx], sme->key, sme->key_len);
...@@ -749,25 +741,15 @@ static int connect(struct wiphy *wiphy, struct net_device *dev, ...@@ -749,25 +741,15 @@ static int connect(struct wiphy *wiphy, struct net_device *dev,
} else if (sme->crypto.wpa_versions & NL80211_WPA_VERSION_2) { } else if (sme->crypto.wpa_versions & NL80211_WPA_VERSION_2) {
if (sme->crypto.cipher_group == WLAN_CIPHER_SUITE_TKIP) { if (sme->crypto.cipher_group == WLAN_CIPHER_SUITE_TKIP) {
u8security = ENCRYPT_ENABLED | WPA2 | TKIP; u8security = ENCRYPT_ENABLED | WPA2 | TKIP;
pcgroup_encrypt_val = "WPA2_TKIP";
pccipher_group = "TKIP";
} else { } else {
u8security = ENCRYPT_ENABLED | WPA2 | AES; u8security = ENCRYPT_ENABLED | WPA2 | AES;
pcgroup_encrypt_val = "WPA2_AES";
pccipher_group = "AES";
} }
pcwpa_version = "WPA_VERSION_2";
} else if (sme->crypto.wpa_versions & NL80211_WPA_VERSION_1) { } else if (sme->crypto.wpa_versions & NL80211_WPA_VERSION_1) {
if (sme->crypto.cipher_group == WLAN_CIPHER_SUITE_TKIP) { if (sme->crypto.cipher_group == WLAN_CIPHER_SUITE_TKIP) {
u8security = ENCRYPT_ENABLED | WPA | TKIP; u8security = ENCRYPT_ENABLED | WPA | TKIP;
pcgroup_encrypt_val = "WPA_TKIP";
pccipher_group = "TKIP";
} else { } else {
u8security = ENCRYPT_ENABLED | WPA | AES; u8security = ENCRYPT_ENABLED | WPA | AES;
pcgroup_encrypt_val = "WPA_AES";
pccipher_group = "AES";
} }
pcwpa_version = "WPA_VERSION_1";
} else { } else {
s32Error = -ENOTSUPP; s32Error = -ENOTSUPP;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment