[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220328113940.6396-8-straube.linux@gmail.com>
Date: Mon, 28 Mar 2022 13:39:38 +0200
From: Michael Straube <straube.linux@...il.com>
To: gregkh@...uxfoundation.org
Cc: Larry.Finger@...inger.net, phil@...lpotter.co.uk,
linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org,
Michael Straube <straube.linux@...il.com>
Subject: [PATCH 7/9] staging: r8188eu: simplify if-else statement
Simplify a nested if-else statement to a single if statement in
rtw_joinbss_reset(). This improves readability and shortens the code.
Signed-off-by: Michael Straube <straube.linux@...il.com>
---
drivers/staging/r8188eu/core/rtw_mlme.c | 18 +++++++-----------
1 file changed, 7 insertions(+), 11 deletions(-)
diff --git a/drivers/staging/r8188eu/core/rtw_mlme.c b/drivers/staging/r8188eu/core/rtw_mlme.c
index 83841cf85a0d..1569f719af1b 100644
--- a/drivers/staging/r8188eu/core/rtw_mlme.c
+++ b/drivers/staging/r8188eu/core/rtw_mlme.c
@@ -1810,19 +1810,15 @@ void rtw_joinbss_reset(struct adapter *padapter)
phtpriv->ampdu_enable = false;/* reset to disabled */
- /* TH = 1 => means that invalidate usb rx aggregation */
- /* TH = 0 => means that validate usb rx aggregation, use init value. */
- if (phtpriv->ht_option) {
- if (padapter->registrypriv.wifi_spec == 1)
- threshold = 1;
- else
- threshold = USB_RXAGG_PAGE_COUNT;
+ /* invalidate usb rx aggregation */
+ threshold = 1;
- rtw_write8(padapter, REG_RXDMA_AGG_PG_TH, threshold);
- } else {
- threshold = 1;
- rtw_write8(padapter, REG_RXDMA_AGG_PG_TH, threshold);
+ if (phtpriv->ht_option && padapter->registrypriv.wifi_spec != 1) {
+ /* validate usb rx aggregation, use init value. */
+ threshold = USB_RXAGG_PAGE_COUNT;
}
+
+ rtw_write8(padapter, REG_RXDMA_AGG_PG_TH, threshold);
}
/* the function is >= passive_level */
--
2.35.1
Powered by blists - more mailing lists