staging: rtl8192e: Remove constant variable bToOtherSTA
authorPhilipp Hortmann <philipp.g.hortmann@gmail.com>
Tue, 3 Oct 2023 19:34:17 +0000 (21:34 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Oct 2023 07:59:39 +0000 (09:59 +0200)
Remove variable bToOtherSTA as it is set to 0 and unchanged. The equations
result accordingly. Remove dead code.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/ecfcd8bff80d98a4e9a2797535a274625607c699.1696360404.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8192e/rtllib_rx.c

index 9a5fdf16f6a18cf1ad583c17a94437bcdc36f03b..124c1651856b5a3dac1470ab60d4fd38f9574ea2 100644 (file)
@@ -1244,7 +1244,6 @@ static int rtllib_rx_InfraAdhoc(struct rtllib_device *ieee, struct sk_buff *skb,
        u8 bssid[ETH_ALEN] = {0};
 
        size_t hdrlen = 0;
-       bool bToOtherSTA = false;
        int ret = 0, i = 0;
 
        fc = le16_to_cpu(hdr->frame_control);
@@ -1278,8 +1277,6 @@ static int rtllib_rx_InfraAdhoc(struct rtllib_device *ieee, struct sk_buff *skb,
 
        /* Filter MGNT Frame */
        if (type == RTLLIB_FTYPE_MGMT) {
-               if (bToOtherSTA)
-                       goto rx_dropped;
                if (rtllib_rx_frame_mgmt(ieee, skb, rx_stats, type, stype))
                        goto rx_dropped;
                else
@@ -1289,10 +1286,8 @@ static int rtllib_rx_InfraAdhoc(struct rtllib_device *ieee, struct sk_buff *skb,
        /* Filter WAPI DATA Frame */
 
        /* Update statstics for AP roaming */
-       if (!bToOtherSTA) {
-               ieee->link_detect_info.NumRecvDataInPeriod++;
-               ieee->link_detect_info.NumRxOkInPeriod++;
-       }
+       ieee->link_detect_info.NumRecvDataInPeriod++;
+       ieee->link_detect_info.NumRxOkInPeriod++;
 
        /* Data frame - extract src/dst addresses */
        rtllib_rx_extract_addr(ieee, hdr, dst, src, bssid);
@@ -1308,7 +1303,7 @@ static int rtllib_rx_InfraAdhoc(struct rtllib_device *ieee, struct sk_buff *skb,
        /* Send pspoll based on moredata */
        if ((ieee->iw_mode == IW_MODE_INFRA)  &&
            (ieee->sta_sleep == LPS_IS_SLEEP) &&
-           (ieee->polling) && (!bToOtherSTA)) {
+           (ieee->polling)) {
                if (WLAN_FC_MORE_DATA(fc)) {
                        /* more data bit is set, let's request a new frame
                         * from the AP
@@ -1334,8 +1329,7 @@ static int rtllib_rx_InfraAdhoc(struct rtllib_device *ieee, struct sk_buff *skb,
        /* Get TS for Rx Reorder  */
        hdr = (struct ieee80211_hdr *)skb->data;
        if (ieee->current_network.qos_data.active && IsQoSDataFrame(skb->data)
-               && !is_multicast_ether_addr(hdr->addr1)
-               && (!bToOtherSTA)) {
+               && !is_multicast_ether_addr(hdr->addr1)) {
                TID = Frame_QoSTID(skb->data);
                SeqNum = WLAN_GET_SEQ_SEQ(sc);
                rtllib_get_ts(ieee, (struct ts_common_info **)&ts, hdr->addr2, TID,
@@ -1366,18 +1360,16 @@ static int rtllib_rx_InfraAdhoc(struct rtllib_device *ieee, struct sk_buff *skb,
        /* Update WAPI PN */
 
        /* Check if leave LPS */
-       if (!bToOtherSTA) {
-               if (ieee->bIsAggregateFrame)
-                       nr_subframes = rxb->nr_subframes;
-               else
-                       nr_subframes = 1;
-               if (unicast)
-                       ieee->link_detect_info.NumRxUnicastOkInPeriod += nr_subframes;
-               rtllib_rx_check_leave_lps(ieee, unicast, nr_subframes);
-       }
+       if (ieee->bIsAggregateFrame)
+               nr_subframes = rxb->nr_subframes;
+       else
+               nr_subframes = 1;
+       if (unicast)
+               ieee->link_detect_info.NumRxUnicastOkInPeriod += nr_subframes;
+       rtllib_rx_check_leave_lps(ieee, unicast, nr_subframes);
 
        /* Indicate packets to upper layer or Rx Reorder */
-       if (!ieee->ht_info->cur_rx_reorder_enable || ts == NULL || bToOtherSTA)
+       if (!ieee->ht_info->cur_rx_reorder_enable || ts == NULL)
                rtllib_rx_indicate_pkt_legacy(ieee, rx_stats, rxb, dst, src);
        else
                RxReorderIndicatePacket(ieee, rxb, ts, SeqNum);