diff mbox series

wifi: brcmsmac: clean up unnecessary current_ampdu_cnt and related checks

Message ID 20240801101531.6626-1-d.kandybka@gmail.com (mailing list archive)
State Accepted
Commit 420a549395c24bf9e4755f9fb220ce72b2f4f8bd
Delegated to: Kalle Valo
Headers show
Series wifi: brcmsmac: clean up unnecessary current_ampdu_cnt and related checks | expand

Commit Message

Dmitry Kandybka Aug. 1, 2024, 10:15 a.m. UTC
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>
---
 .../broadcom/brcm80211/brcmsmac/ampdu.c       | 22 +------------------
 1 file changed, 1 insertion(+), 21 deletions(-)

Comments

Arend van Spriel Aug. 2, 2024, 6:15 a.m. UTC | #1
On August 1, 2024 12:15:35 PM Dmitry Kandybka <d.kandybka@gmail.com> wrote:

> 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.

Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
> Signed-off-by: Dmitry Kandybka <d.kandybka@gmail.com>
> ---
> .../broadcom/brcm80211/brcmsmac/ampdu.c       | 22 +------------------
> 1 file changed, 1 insertion(+), 21 deletions(-)
Kalle Valo Aug. 4, 2024, 9:11 a.m. UTC | #2
Dmitry Kandybka <d.kandybka@gmail.com> wrote:

> 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>

Patch applied to wireless-next.git, thanks.

420a549395c2 wifi: brcmsmac: clean up unnecessary current_ampdu_cnt and related checks
diff mbox series

Patch

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/ampdu.c b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/ampdu.c
index 33d17b779201..a767cbb79185 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/ampdu.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/ampdu.c
@@ -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);