diff options
| author | 2022-03-29 22:21:39 +0200 | |
|---|---|---|
| committer | 2022-04-04 07:33:47 +0200 | |
| commit | a90b92ede242d07801c238bcfe4a28382a8219cb (patch) | |
| tree | a3c2b2e6cd743f24fa314b094ad4f357ef34996a /drivers | |
| parent | staging: r8188eu: remove HW_VAR_RXDMA_AGG_PG_TH from SetHwReg8188EU() (diff) | |
staging: r8188eu: simplify if-else statement
Simplify a nested if-else statement to a single if-else statement in
rtw_set_threshold(). This improves readability and allows us to
remove the local variable threshold.
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220329202141.7028-7-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/staging/r8188eu/core/rtw_mlme.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/staging/r8188eu/core/rtw_mlme.c b/drivers/staging/r8188eu/core/rtw_mlme.c index 086d64542082..1d52cfac1999 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme.c +++ b/drivers/staging/r8188eu/core/rtw_mlme.c @@ -1789,20 +1789,14 @@ void rtw_update_registrypriv_dev_network(struct adapter *adapter) static void rtw_set_threshold(struct adapter *adapter) { - u8 threshold; struct mlme_priv *mlmepriv = &adapter->mlmepriv; struct ht_priv *htpriv = &mlmepriv->htpriv; - /* TH = 1 => means that invalidate usb rx aggregation */ - /* TH = 0 => means that validate usb rx aggregation, use init value. */ - if (htpriv->ht_option) { - if (adapter->registrypriv.wifi_spec == 1) - threshold = 1; - else - threshold = USB_RXAGG_PAGE_COUNT; - - rtw_write8(adapter, REG_RXDMA_AGG_PG_TH, threshold); + if (htpriv->ht_option && adapter->registrypriv.wifi_spec != 1) { + /* validate usb rx aggregation, use init value. */ + rtw_write8(adapter, REG_RXDMA_AGG_PG_TH, USB_RXAGG_PAGE_COUNT); } else { + /* invalidate usb rx aggregation */ rtw_write8(adapter, REG_RXDMA_AGG_PG_TH, 1); } } |
