[PATCH 5/9] staging: rtl8188eu: simplify rtw_get_wireless_stats

From: Martin Kaiser
Date: Sat Jun 05 2021 - 12:59:33 EST


Remove unnecessary temporary variables.

Signed-off-by: Martin Kaiser <martin@xxxxxxxxx>
---
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c | 15 ++++-----------
1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c
index ebd61ba93ef0..70c028e06aee 100644
--- a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c
+++ b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c
@@ -2920,25 +2920,18 @@ static struct iw_statistics *rtw_get_wireless_stats(struct net_device *dev)
{
struct adapter *padapter = netdev_priv(dev);
struct iw_statistics *piwstats = &padapter->iwstats;
- int tmp_level = 0;
- int tmp_qual = 0;
- int tmp_noise = 0;

if (!check_fwstate(&padapter->mlmepriv, _FW_LINKED)) {
piwstats->qual.qual = 0;
piwstats->qual.level = 0;
piwstats->qual.noise = 0;
} else {
- tmp_level = padapter->recvpriv.signal_strength;
- tmp_qual = padapter->recvpriv.signal_qual;
- tmp_noise = padapter->recvpriv.noise;
-
- piwstats->qual.level = tmp_level;
- piwstats->qual.qual = tmp_qual;
- piwstats->qual.noise = tmp_noise;
+ piwstats->qual.level = padapter->recvpriv.signal_strength;
+ piwstats->qual.qual = padapter->recvpriv.signal_qual;
+ piwstats->qual.noise = padapter->recvpriv.noise;
}
piwstats->qual.updated = IW_QUAL_ALL_UPDATED;/* IW_QUAL_DBM; */
- return &padapter->iwstats;
+ return piwstats;
}

struct iw_handler_def rtw_handlers_def = {
--
2.20.1