staging: rtl8192e: Remove variable host_encrypt as it is constant
ieee->host_encrypt also named priv->rtllib->host_encrypt is initialized to 1 and then unchanged. All evaluations will result accordingly. Remove resulting dead code. Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> Link: https://lore.kernel.org/r/bc4ea0492306f708f0e5cac6bf0239deb3cd9a80.1687583718.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
d6128d77ff
commit
1047daace0
@ -804,7 +804,6 @@ static void _rtl92e_init_priv_variable(struct net_device *dev)
|
||||
priv->rtllib->iw_mode = IW_MODE_INFRA;
|
||||
priv->rtllib->active_scan = 1;
|
||||
priv->rtllib->be_scan_inprogress = false;
|
||||
priv->rtllib->host_encrypt = 1;
|
||||
priv->rtllib->host_decrypt = 1;
|
||||
|
||||
priv->rtllib->fts = DEFAULT_FRAG_THRESHOLD;
|
||||
|
@ -1441,7 +1441,6 @@ struct rtllib_device {
|
||||
*/
|
||||
|
||||
/* If the host performs {en,de}cryption, then set to 1 */
|
||||
int host_encrypt;
|
||||
int host_decrypt;
|
||||
|
||||
int ieee802_1x; /* is IEEE 802.1X used */
|
||||
|
@ -98,7 +98,6 @@ struct net_device *alloc_rtllib(int sizeof_priv)
|
||||
ieee->open_wep = 1;
|
||||
|
||||
/* Default to enabling full open WEP with host based encrypt/decrypt */
|
||||
ieee->host_encrypt = 1;
|
||||
ieee->host_decrypt = 1;
|
||||
ieee->ieee802_1x = 1; /* Default to supporting 802.1x */
|
||||
|
||||
|
@ -807,7 +807,7 @@ static struct sk_buff *rtllib_probe_resp(struct rtllib_device *ieee,
|
||||
}
|
||||
|
||||
crypt = ieee->crypt_info.crypt[ieee->crypt_info.tx_keyidx];
|
||||
encrypt = ieee->host_encrypt && crypt && crypt->ops &&
|
||||
encrypt = crypt && crypt->ops &&
|
||||
((strcmp(crypt->ops->name, "R-WEP") == 0 || wpa_ie_len));
|
||||
if (ieee->ht_info->bCurrentHTSupport) {
|
||||
tmp_ht_cap_buf = (u8 *)&(ieee->ht_info->SelfHTCap);
|
||||
@ -943,10 +943,7 @@ static struct sk_buff *rtllib_assoc_resp(struct rtllib_device *ieee, u8 *dest)
|
||||
assoc->capability |=
|
||||
cpu_to_le16(WLAN_CAPABILITY_SHORT_SLOT_TIME);
|
||||
|
||||
if (ieee->host_encrypt)
|
||||
crypt = ieee->crypt_info.crypt[ieee->crypt_info.tx_keyidx];
|
||||
else
|
||||
crypt = NULL;
|
||||
crypt = ieee->crypt_info.crypt[ieee->crypt_info.tx_keyidx];
|
||||
|
||||
encrypt = (crypt && crypt->ops);
|
||||
|
||||
@ -1115,7 +1112,7 @@ rtllib_association_req(struct rtllib_network *beacon,
|
||||
|
||||
crypt = ieee->crypt_info.crypt[ieee->crypt_info.tx_keyidx];
|
||||
if (crypt != NULL)
|
||||
encrypt = ieee->host_encrypt && crypt && crypt->ops &&
|
||||
encrypt = crypt && crypt->ops &&
|
||||
((strcmp(crypt->ops->name, "R-WEP") == 0 ||
|
||||
wpa_ie_len));
|
||||
else
|
||||
@ -2995,8 +2992,7 @@ u8 rtllib_ap_sec_type(struct rtllib_device *ieee)
|
||||
|
||||
crypt = ieee->crypt_info.crypt[ieee->crypt_info.tx_keyidx];
|
||||
encrypt = (ieee->current_network.capability & WLAN_CAPABILITY_PRIVACY)
|
||||
|| (ieee->host_encrypt && crypt && crypt->ops &&
|
||||
(strcmp(crypt->ops->name, "R-WEP") == 0));
|
||||
|| (crypt && crypt->ops && (strcmp(crypt->ops->name, "R-WEP") == 0));
|
||||
|
||||
/* simply judge */
|
||||
if (encrypt && (wpa_ie_len == 0)) {
|
||||
|
@ -635,8 +635,7 @@ static int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev)
|
||||
|
||||
skb->priority = rtllib_classify(skb, IsAmsdu);
|
||||
crypt = ieee->crypt_info.crypt[ieee->crypt_info.tx_keyidx];
|
||||
encrypt = !(ether_type == ETH_P_PAE && ieee->ieee802_1x) &&
|
||||
ieee->host_encrypt && crypt && crypt->ops;
|
||||
encrypt = !(ether_type == ETH_P_PAE && ieee->ieee802_1x) && crypt && crypt->ops;
|
||||
if (!encrypt && ieee->ieee802_1x &&
|
||||
ieee->drop_unencrypted && ether_type != ETH_P_PAE) {
|
||||
stats->tx_dropped++;
|
||||
|
Loading…
x
Reference in New Issue
Block a user