linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] wifi: brcmsmac: clean up unnecessary current_ampdu_cnt and related checks
@ 2024-08-01 10:15 Dmitry Kandybka
  2024-08-02  6:15 ` Arend Van Spriel
  2024-08-04  9:11 ` Kalle Valo
  0 siblings, 2 replies; 3+ messages in thread
From: Dmitry Kandybka @ 2024-08-01 10:15 UTC (permalink / raw)
  To: Arend van Spriel; +Cc: linux-wireless, lvc-project, Dmitry Antipov

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

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);
 
-- 
2.43.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] wifi: brcmsmac: clean up unnecessary current_ampdu_cnt and related checks
  2024-08-01 10:15 [PATCH] wifi: brcmsmac: clean up unnecessary current_ampdu_cnt and related checks Dmitry Kandybka
@ 2024-08-02  6:15 ` Arend Van Spriel
  2024-08-04  9:11 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Arend Van Spriel @ 2024-08-02  6:15 UTC (permalink / raw)
  To: Dmitry Kandybka; +Cc: linux-wireless, lvc-project, Dmitry Antipov

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




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] wifi: brcmsmac: clean up unnecessary current_ampdu_cnt and related checks
  2024-08-01 10:15 [PATCH] wifi: brcmsmac: clean up unnecessary current_ampdu_cnt and related checks Dmitry Kandybka
  2024-08-02  6:15 ` Arend Van Spriel
@ 2024-08-04  9:11 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2024-08-04  9:11 UTC (permalink / raw)
  To: Dmitry Kandybka
  Cc: Arend van Spriel, linux-wireless, lvc-project, Dmitry Antipov

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

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20240801101531.6626-1-d.kandybka@gmail.com/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-08-04  9:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-01 10:15 [PATCH] wifi: brcmsmac: clean up unnecessary current_ampdu_cnt and related checks Dmitry Kandybka
2024-08-02  6:15 ` Arend Van Spriel
2024-08-04  9:11 ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).