[PATCH 7/9] staging: r8188eu: simplify if-else statement

Michael Straube
2022-03-28T11:50:15Z

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