Commit a56cbbcc authored by Philipp Hortmann's avatar Philipp Hortmann Committed by Greg Kroah-Hartman
Browse files

staging: rtl8192e: Remove variable host_decrypt as it is constant



ieee->host_decrypt also named priv->rtllib->host_decrypt is initialized
to 1 and then unchanged. All evaluations will result accordingly. Remove
resulting dead code.

Signed-off-by: default avatarPhilipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/637350e9bc3edded665009a30d12350157e8a9a9.1687583718.git.philipp.g.hortmann@gmail.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1047daac
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -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_decrypt = 1;

	priv->rtllib->fts = DEFAULT_FRAG_THRESHOLD;

+0 −3
Original line number Diff line number Diff line
@@ -1440,9 +1440,6 @@ struct rtllib_device {
				 * WEP key changes
				 */

	/* If the host performs {en,de}cryption, then set to 1 */
	int host_decrypt;

	int ieee802_1x; /* is IEEE 802.1X used */

	/* WPA data */
+0 −2
Original line number Diff line number Diff line
@@ -97,8 +97,6 @@ struct net_device *alloc_rtllib(int sizeof_priv)
	ieee->scan_age = DEFAULT_MAX_SCAN_AGE;
	ieee->open_wep = 1;

	/* Default to enabling full open WEP with host based encrypt/decrypt */
	ieee->host_decrypt = 1;
	ieee->ieee802_1x = 1; /* Default to supporting 802.1x */

	ieee->rtllib_ap_sec_type = rtllib_ap_sec_type;
+21 −23
Original line number Diff line number Diff line
@@ -1035,7 +1035,6 @@ static int rtllib_rx_get_crypt(struct rtllib_device *ieee, struct sk_buff *skb,
	u16 fc = le16_to_cpu(hdr->frame_ctl);
	int idx = 0;

	if (ieee->host_decrypt) {
	if (skb->len >= hdrlen + 3)
		idx = skb->data[hdrlen + 3] >> 6;

@@ -1058,7 +1057,6 @@ static int rtllib_rx_get_crypt(struct rtllib_device *ieee, struct sk_buff *skb,
			   hdr->addr2);
		return -1;
	}
	}

	return 0;
}
@@ -1083,7 +1081,7 @@ static int rtllib_rx_decrypt(struct rtllib_device *ieee, struct sk_buff *skb,
		ieee->need_sw_enc = 0;

	keyidx = rtllib_rx_frame_decrypt(ieee, skb, crypt);
	if (ieee->host_decrypt && (fc & RTLLIB_FCTL_WEP) && (keyidx < 0)) {
	if ((fc & RTLLIB_FCTL_WEP) && (keyidx < 0)) {
		netdev_info(ieee->dev, "%s: decrypt frame error\n", __func__);
		return -1;
	}
@@ -1147,7 +1145,7 @@ static int rtllib_rx_decrypt(struct rtllib_device *ieee, struct sk_buff *skb,
	/* skb: hdr + (possible reassembled) full MSDU payload; possibly still
	 * encrypted/authenticated
	 */
	if (ieee->host_decrypt && (fc & RTLLIB_FCTL_WEP) &&
	if ((fc & RTLLIB_FCTL_WEP) &&
		rtllib_rx_frame_decrypt_msdu(ieee, skb, keyidx, crypt)) {
		netdev_info(ieee->dev, "%s: ==>decrypt msdu error\n", __func__);
		return -1;