diff options
Diffstat (limited to 'kernel/drivers/staging/rtl8188eu/core/rtw_wlan_util.c')
-rw-r--r-- | kernel/drivers/staging/rtl8188eu/core/rtw_wlan_util.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/kernel/drivers/staging/rtl8188eu/core/rtw_wlan_util.c b/kernel/drivers/staging/rtl8188eu/core/rtw_wlan_util.c index 2b371757c..59b443255 100644 --- a/kernel/drivers/staging/rtl8188eu/core/rtw_wlan_util.c +++ b/kernel/drivers/staging/rtl8188eu/core/rtw_wlan_util.c @@ -19,6 +19,8 @@ ******************************************************************************/ #define _RTW_WLAN_UTIL_C_ +#include <linux/ieee80211.h> + #include <osdep_service.h> #include <drv_types.h> #include <wifi.h> @@ -603,7 +605,7 @@ void WMMOnAssocRsp(struct adapter *padapter) inx[0] = 0; inx[1] = 1; inx[2] = 2; inx[3] = 3; if (pregpriv->wifi_spec == 1) { - u32 j, tmp, change_inx = false; + u32 j, change_inx = false; /* entry indx: 0->vo, 1->vi, 2->be, 3->bk. */ for (i = 0; i < 4; i++) { @@ -618,14 +620,8 @@ void WMMOnAssocRsp(struct adapter *padapter) } if (change_inx) { - tmp = edca[i]; - edca[i] = edca[j]; - edca[j] = tmp; - - tmp = inx[i]; - inx[i] = inx[j]; - inx[j] = tmp; - + swap(edca[i], edca[j]); + swap(inx[i], inx[j]); change_inx = false; } } @@ -1231,7 +1227,7 @@ unsigned int update_basic_rate(unsigned char *ptn, unsigned int ptn_sz) unsigned int i, num_of_rate; unsigned int mask = 0; - num_of_rate = (ptn_sz > NumRates) ? NumRates : ptn_sz; + num_of_rate = min_t(unsigned int, ptn_sz, NumRates); for (i = 0; i < num_of_rate; i++) { if ((*(ptn + i)) & 0x80) @@ -1245,7 +1241,7 @@ unsigned int update_supported_rate(unsigned char *ptn, unsigned int ptn_sz) unsigned int i, num_of_rate; unsigned int mask = 0; - num_of_rate = (ptn_sz > NumRates) ? NumRates : ptn_sz; + num_of_rate = min_t(unsigned int, ptn_sz, NumRates); for (i = 0; i < num_of_rate; i++) mask |= 0x1 << wifirate2_ratetbl_inx(*(ptn + i)); @@ -1418,13 +1414,15 @@ void update_IOT_info(struct adapter *padapter) pmlmeinfo->turboMode_cts2self = 0; pmlmeinfo->turboMode_rtsen = 1; /* disable high power */ - Switch_DM_Func(padapter, (~DYNAMIC_BB_DYNAMIC_TXPWR), false); + Switch_DM_Func(padapter, (u32)(~DYNAMIC_BB_DYNAMIC_TXPWR), + false); break; case HT_IOT_PEER_REALTEK: /* rtw_write16(padapter, 0x4cc, 0xffff); */ /* rtw_write16(padapter, 0x546, 0x01c0); */ /* disable high power */ - Switch_DM_Func(padapter, (~DYNAMIC_BB_DYNAMIC_TXPWR), false); + Switch_DM_Func(padapter, (u32)(~DYNAMIC_BB_DYNAMIC_TXPWR), + false); break; default: pmlmeinfo->turboMode_cts2self = 0; |