]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
wifi: brcmsmac: clean up unnecessary current_ampdu_cnt and related checks
authorDmitry Kandybka <d.kandybka@gmail.com>
Thu, 1 Aug 2024 10:15:31 +0000 (13:15 +0300)
committerKalle Valo <kvalo@kernel.org>
Sun, 4 Aug 2024 09:11:34 +0000 (12:11 +0300)
In 'brcms_c_ffpld_check_txfunfl()', 'current_ampdu_cnt' is hardcoded to
zero, so 'txunfl_ratio' is always zero as well and some dead code can be
removed. Compile tested only.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Dmitry Kandybka <d.kandybka@gmail.com>
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://patch.msgid.link/20240801101531.6626-1-d.kandybka@gmail.com
drivers/net/wireless/broadcom/brcm80211/brcmsmac/ampdu.c

index 33d17b779201d2adfb172f1b18d3237f469005c1..a767cbb791858cd2e2bd6dcd254260074da40aaf 100644 (file)
@@ -351,9 +351,7 @@ static int brcms_c_ffpld_check_txfunfl(struct brcms_c_info *wlc, int fid)
 {
        struct ampdu_info *ampdu = wlc->ampdu;
        u32 phy_rate = mcs_2_rate(FFPLD_MAX_MCS, true, false);
-       u32 txunfl_ratio;
        u8 max_mpdu;
-       u32 current_ampdu_cnt = 0;
        u16 max_pld_size;
        u32 new_txunfl;
        struct brcms_fifo_info *fifo = (ampdu->fifo_tb + fid);
@@ -389,26 +387,8 @@ static int brcms_c_ffpld_check_txfunfl(struct brcms_c_info *wlc, int fid)
        if (fifo->accum_txfunfl < 10)
                return 0;
 
-       brcms_dbg_ht(wlc->hw->d11core, "ampdu_count %d  tx_underflows %d\n",
-                    current_ampdu_cnt, fifo->accum_txfunfl);
+       brcms_dbg_ht(wlc->hw->d11core, "tx_underflows %d\n", fifo->accum_txfunfl);
 
-       /*
-          compute the current ratio of tx unfl per ampdu.
-          When the current ampdu count becomes too
-          big while the ratio remains small, we reset
-          the current count in order to not
-          introduce too big of a latency in detecting a
-          large amount of tx underflows later.
-        */
-
-       txunfl_ratio = current_ampdu_cnt / fifo->accum_txfunfl;
-
-       if (txunfl_ratio > ampdu->tx_max_funl) {
-               if (current_ampdu_cnt >= FFPLD_MAX_AMPDU_CNT)
-                       fifo->accum_txfunfl = 0;
-
-               return 0;
-       }
        max_mpdu = min_t(u8, fifo->mcs2ampdu_table[FFPLD_MAX_MCS],
                         AMPDU_NUM_MPDU_LEGACY);